Skip to content

Get a free database

agentry doesn't host databases — it wires whatever database you already have into every sandbox (see Add a database). If you don't have one yet, every provider below has a genuinely free tier that's plenty for prototypes and early production.

The pattern is the same every time:

  1. Create a free database with the provider.
  2. Copy its connection string.
  3. Run agentry service bind <type> on your server and paste it.

That's it — every sandbox you create afterward inherits the connection.

Which one?

  • PostgresSupabase (also gives you auth + storage) or Neon (serverless, scales to zero, instant branches).
  • MongoDBAtlas.
  • RedisUpstash.
  • MySQLAiven.

Supabase (Postgres)

Free tier: 2 projects, 500 MB database, 5 GB egress. Projects pause after ~1 week of inactivity and resume on the next request.

  1. Sign up at supabase.comNew project.
  2. Pick a name, a region close to your server, and set a database password — save it; you'll need it in the connection string. (You can reset it later under Project Settings → Database.)
  3. Wait ~2 minutes for it to provision.
  4. Click Connect (top of the dashboard) → Connection stringURI.

You'll see a few options. Pick the right one:

OptionHost looks likeUse it when
Session pooleraws-0-<region>.pooler.supabase.com:5432Default choice. Works over IPv4 everywhere.
Transaction pooler...pooler.supabase.com:6543Serverless/edge with many short-lived connections.
Direct connectiondb.<ref>.supabase.co:5432Only if your server has IPv6.

Use the Session pooler string

Supabase's direct connection is IPv6-only on the free tier. Most servers (and Docker containers) reach the internet over IPv4, so the direct string will hang with a connection timeout. Pick Session pooler — its username is postgres.<project-ref>, not just postgres.

The string looks like:

postgresql://postgres.abcdefgh:YOUR-PASSWORD@aws-0-us-east-1.pooler.supabase.com:5432/postgres

Replace YOUR-PASSWORD with the password from step 2, then bind it:

bash
agentry service bind postgres
# paste the URI when prompted

Every sandbox now gets DATABASE_URL and POSTGRES_URL.


Neon (Postgres)

Free tier: 0.5 GB storage, scales to zero when idle, database branching (a throwaway copy per prototype — a great fit for sandboxes).

  1. Sign up at neon.techCreate project. Pick a region near your server.
  2. On the project dashboard, the Connection string is shown immediately — click Copy.
  3. Neon defaults to the pooled connection (host contains -pooler). Keep it unless a migration tool complains, in which case use the unpooled host (toggle Connection pooling off in the snippet).

The string looks like:

postgresql://alex:npg_xxxx@ep-cool-bird-12345-pooler.us-east-1.aws.neon.tech/neondb?sslmode=require

Keep ?sslmode=require

Neon requires TLS. Leave the ?sslmode=require suffix on the URL — strip it and the connection is refused.

bash
agentry service bind postgres
# paste the URI

Branch per prototype (optional): in Neon, create a branch (mainNew branch), copy its connection string, and bind that to a second agentry server — now that server's sandboxes hit an isolated copy of your data.


MongoDB Atlas

Free tier: M0 cluster, 512 MB storage, shared. One free cluster per project.

  1. Sign up at mongodb.com/atlasCreate → choose the M0 (Free) tier → pick a provider/region near your server → Create.
  2. Create a database user (the setup wizard prompts you): pick a username and password. Save them.
  3. Network access — this is the step everyone misses. Go to Network Access → Add IP Address:
    • Easiest: Allow access from anywhere (0.0.0.0/0). Fine for a prototype since the user/password still gate access.
    • Tighter: add your server's public/egress IP only. Find it with agentry exec <server> -- curl -s ifconfig.me or check your host provider.
  4. Connect → Drivers → copy the connection string.

It looks like:

mongodb+srv://myuser:<db_password>@cluster0.ab1cd.mongodb.net/?retryWrites=true&w=majority

Replace <db_password> with the password from step 2. Optionally add a default database name before the ?:

mongodb+srv://myuser:s3cret@cluster0.ab1cd.mongodb.net/myapp?retryWrites=true&w=majority
bash
agentry service bind mongodb
# paste the URI → sandboxes get MONGODB_URL

"Connection timed out" / "no reachable servers"

Nine times out of ten this is the IP allowlist (step 3), not a bad password. Add 0.0.0.0/0 and retry.


Upstash (Redis)

Free tier: serverless Redis, 256 MB, 500 K commands/month, TLS included.

  1. Sign up at upstash.comCreate Database → pick a region near your server → Create.
  2. On the database page, find Connect → Redis (or the rediss:// field at the top).
  3. Copy the rediss:// URL (note the double s — it's TLS).
rediss://default:AbCdEf123456@apn1-clever-cat-12345.upstash.io:6379
bash
agentry service bind redis
# paste → sandboxes get REDIS_URL

Use the rediss:// (TLS) URL

Upstash only accepts encrypted connections. The plain redis:// form will be rejected — copy the rediss:// one.


MySQL (Aiven)

PlanetScale removed its free tier in 2024. For a free MySQL, Aiven offers a free plan (1 GB) for MySQL, Postgres, and Redis.

  1. Sign up at aiven.ioCreate serviceMySQL → select the Free plan → pick a cloud/region → Create.
  2. Wait for the service to reach Running.
  3. On the Overview tab, copy the Service URI.
mysql://avnadmin:AVNS_xxxx@mysql-xxxx.aivencloud.com:12345/defaultdb?ssl-mode=REQUIRED
bash
agentry service bind mysql
# paste → sandboxes get DATABASE_URL and MYSQL_URL

Aiven enforces TLS; keep the ?ssl-mode=REQUIRED suffix.


After you bind

  • Confirm it stuck: agentry service list.

  • The env var only lands in new sandboxes. If you bound after creating one, retrofit it.

  • Tell the agent the binding exists so it doesn't build an in-memory fake:

    A real Postgres is bound to this server at DATABASE_URL. Use it for the data layer — no SQLite, no in-memory store.

  • Every sandbox sees the same connection — there's no automatic per-sandbox isolation. To keep prototypes from colliding, ask the agent to namespace (a Postgres schema, a Mongo database name, a Redis key prefix). See Add a database.

Next

agentry — run AI-built apps on your own hardware.