# 64 / 5.000 How can I work with a local database in the backend?

**URL:** <https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198>\
**Category:** General\
**Created:** [May 20, 2024, 8:52am UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198 "2024-05-20T08:52:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clever\_Machaca](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/clever_machaca/32/174_2.png) [@Clever\_Machaca](https://community.firebasestudio.dev/u/Clever_Machaca)\
**Post date:** [May 20, 2024, 8:52am UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/1 "2024-05-20T08:52:54Z")

</div>

I am trying to use docker to create using postgreSQL but it is not working

---

<div class="post-metadata">

**Author:** ![essayoub](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/essayoub/32/162_2.png) [@essayoub](https://community.firebasestudio.dev/u/essayoub)\
**Post date:** [May 20, 2024, 12:52pm UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/2 "2024-05-20T12:52:05Z")

</div>

Try to expose your database in your local machine with Ngrok, that will generate a link accessible from the internet and use it on your idx workspace

1. install ngrok in your local machine
2. expose your postrges port: `ngrok tcp 5432`

ngrok will forward your local port to a URL like this: tcp://0.tcp.ngrok.io:5432  
now use that link as a connection string to your database in idx worspace

---

<div class="post-metadata">

**Author:** ![Clever\_Machaca](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/clever_machaca/32/174_2.png) [@Clever\_Machaca](https://community.firebasestudio.dev/u/Clever_Machaca)\
**Post date:** [May 20, 2024, 1:15pm UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/3 "2024-05-20T13:15:13Z")

</div>

there is no way to use docker in IDX?

---

<div class="post-metadata">

**Author:** ![Vova](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/vova/32/12_2.png) [@Vova](https://community.firebasestudio.dev/u/Vova)\
**Post date:** [May 27, 2024, 4:29pm UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/4 "2024-05-27T16:29:22Z")

</div>

Docker is indeed fully supported on IDX, to enable it, just add this line to your dev.nix file:

```auto
services.docker.enable = true;

```

This will install docker cli as well as launch the docker daemon inside your workspace.

---

<div class="post-metadata">

**Author:** ![Adam](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/adam/32/1628_2.png) [@Adam](https://community.firebasestudio.dev/u/Adam)\
**Post date:** [September 7, 2024, 2:13pm UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/5 "2024-09-07T14:13:37Z")

</div>

How can I install ngrok in IDX?

---

<div class="post-metadata">

**Author:** ![islam](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/islam/32/2078_2.png) [@islam](https://community.firebasestudio.dev/u/islam)\
**Post date:** [March 12, 2025, 9:39am UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/6 "2025-03-12T09:39:45Z")

</div>

u can either use the dev.nix file u can find in the .idx folder by adding the package manually or by simply openning a terminal and typing ngrok (u can also get the specific version of the package using wget or curl)

---

<div class="post-metadata">

**Author:** ![Middle\_quiter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/middle_quiter/32/1694_2.png) [@Middle\_quiter](https://community.firebasestudio.dev/u/Middle_quiter)\
**Post date:** [September 14, 2025, 9:04am UTC](https://community.firebasestudio.dev/t/64-5-000-how-can-i-work-with-a-local-database-in-the-backend/198/7 "2025-09-14T09:04:08Z")

</div>

what if I need to connect to database on idx via local machine
