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:
- Create a free database with the provider.
- Copy its connection string.
- Run
agentry service bind <type>on your server and paste it.
That's it — every sandbox you create afterward inherits the connection.
Which one?
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.
- Sign up at supabase.com → New project.
- 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.)
- Wait ~2 minutes for it to provision.
- Click Connect (top of the dashboard) → Connection string → URI.
You'll see a few options. Pick the right one:
| Option | Host looks like | Use it when |
|---|---|---|
| Session pooler ✅ | aws-0-<region>.pooler.supabase.com:5432 | Default choice. Works over IPv4 everywhere. |
| Transaction pooler | ...pooler.supabase.com:6543 | Serverless/edge with many short-lived connections. |
| Direct connection | db.<ref>.supabase.co:5432 | Only 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/postgresReplace YOUR-PASSWORD with the password from step 2, then bind it:
agentry service bind postgres
# paste the URI when promptedEvery 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).
- Sign up at neon.tech → Create project. Pick a region near your server.
- On the project dashboard, the Connection string is shown immediately — click Copy.
- 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=requireKeep ?sslmode=require
Neon requires TLS. Leave the ?sslmode=require suffix on the URL — strip it and the connection is refused.
agentry service bind postgres
# paste the URIBranch per prototype (optional): in Neon, create a branch (main → New 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.
- Sign up at mongodb.com/atlas → Create → choose the M0 (Free) tier → pick a provider/region near your server → Create.
- Create a database user (the setup wizard prompts you): pick a username and password. Save them.
- 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.meor check your host provider.
- Easiest: Allow access from anywhere (
- Connect → Drivers → copy the connection string.
It looks like:
mongodb+srv://myuser:<db_password>@cluster0.ab1cd.mongodb.net/?retryWrites=true&w=majorityReplace <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=majorityagentry 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.
- Sign up at upstash.com → Create Database → pick a region near your server → Create.
- On the database page, find Connect → Redis (or the
rediss://field at the top). - Copy the
rediss://URL (note the doubles— it's TLS).
rediss://default:AbCdEf123456@apn1-clever-cat-12345.upstash.io:6379agentry service bind redis
# paste → sandboxes get REDIS_URLUse 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.
- Sign up at aiven.io → Create service → MySQL → select the Free plan → pick a cloud/region → Create.
- Wait for the service to reach Running.
- On the Overview tab, copy the Service URI.
mysql://avnadmin:AVNS_xxxx@mysql-xxxx.aivencloud.com:12345/defaultdb?ssl-mode=REQUIREDagentry service bind mysql
# paste → sandboxes get DATABASE_URL and MYSQL_URLAiven 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
- Add a database — the binding mechanics in full.
- How bindings work — the model behind every binding.
- Ship an app — the bound connection carries through to production.