To generate synthetic databases, MOSTLY AI requires an empty database that it can use to write synthetic databases to. If there’s no possibility of creating an empty database in your existing systems, this short guide will help you create an empty Postgres database on your local machine that MOSTLY AI can access.
Download, install, and launch Docker desktop
Install and configure ngrok
It’s free, but you have to sign up to use it.
Create a file named
mostly-ai-postgresql-compose.ymland paste the below contents.
version: '3.7' services: mostly_ai_sd_db: image: postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: changeme POSTGRES_DB: my_synthetic_db ports: - "5432:5432" volumes: - mostly_ai_sd_db:/var/lib/postgresql/data volumes: mostly_ai_sd_db:
Now you have everything ready to launch the enpty Postgres database.
Open a terminal and execute
docker compose -f ./mostly-ai-postgresql-compose.yml up -d
To verify that your empty database is running, run
docker compose -f ./mostly-ai-postgresql-compose.yml logsand check that the last line mentions
database system is ready to accept connections.
Lastly, you can expose your empty database to the internet by running
ngrok tcp 5432.
The output text shows what address and port you must use to create your connector.
To terminate your database, run
docker compose -f mostly-ai-postgresql-compose.yml down in the folder where you saved the docker compose file.