Apps with Postgres

Host a full-stack app with a Postgres database

Most apps an agent builds want a real database. Here Postgres is a second container of the same app: no separate service to sign up for, no connection string to copy between dashboards, and its data stays on its own volume.

Paste this into your coding agent

Run curl -s https://vibecodedhost.com/deploy.md and follow its instructions to deploy this project.

Works in Claude Code, Codex, Cursor and anything else that can run a shell command.

The files

What your agent writes.

You do not have to write any of this. It is here so you can see how little there is, and check your agent's work if a deploy goes wrong.

With this manifest the app would be live at https://my-app.vibecodedhost.app. The name is yours to choose, as long as no other app has it.

Every field of vibe.json, explained →

vibe.json
{
  "version": 1,
  "name": "my-app",
  "containers": [
    {
      "name": "db",
      "image": "postgres:16-alpine",
      "port": 5432,
      "env": {
        "POSTGRES_USER": "app",
        "POSTGRES_PASSWORD": "app",
        "POSTGRES_DB": "app"
      },
      "volume": "/var/lib/postgresql/data",
      "memoryMb": 384
    },
    {
      "name": "web",
      "build": {
        "context": ".",
        "dockerfile": "Dockerfile"
      },
      "port": 3000,
      "public": true,
      "env": {
        "NODE_ENV": "production",
        "DATABASE_URL": "postgres://app:app@db:5432/app"
      },
      "healthPath": "/"
    }
  ]
}

Worth knowing

Apps with Postgres on Vibe Hosting

Reach it by name

Containers of one app share a private network. Your code connects to db:5432, the container's name, with no IP address or hostname to look up.

Not exposed to the internet

Only containers marked public get an address. The database can be reached by your app's containers and by nothing else, including other apps on the platform.

Data survives redeploys

The volume at /var/lib/postgresql/data belongs to the database container and is kept from one deployment to the next.

List the database first, and retry

Containers start in the order they are listed, so put Postgres before the app. It still takes a few seconds to initialise an empty volume, so have the app retry its first connection.

Back up what matters

This is hosting for work in progress, and volumes can be lost. For data you care about, have your agent add a pg_dump you can download.

Questions

Before you deploy.

Can I use MySQL, Redis or another database instead?

An app can run any stock image with an explicit tag from a public registry such as Docker Hub, as long as it fits in the app's memory and runs in the sandbox. Postgres is the one our own example uses.

How big can the database get?

Storage is 2 GB for a free app and 50 GB once subscribed, counted across all of the app's volumes.

Built something else? Next.js, Node.js and Express, FastAPI, Flask, Django, React and Vite, Apps with SQLite, Docker Compose projects.

Your app could be online in a few minutes.

Copy the sentence, paste it into your agent, and read the address it gives you back. No account, no card, nothing to pay.

Paste this into your coding agent

Run curl -s https://vibecodedhost.com/deploy.md and follow its instructions to deploy this project.

Works in Claude Code, Codex, Cursor and anything else that can run a shell command.

Would you rather hold the key yourself?

Questions first, or stuck? Contact support and a person replies as soon as possible.