Add a managed Postgres, MySQL or Redis instance to your EthioDeploy project, with connection strings injected automatically. Connect to Postgres from your own computer and restore an existing dump.
Last updated
All docs as plain textAdd a managed Postgres, MySQL or Redis instance from your project's Addons tab. Both provision on the same box as your app, no separate service to wire up.
DATABASE_URL. A project can have Postgres or MySQL, not both.Once an addon finishes provisioning, its connection string is injected into your app as an env var automatically. Nothing to copy or paste. Adding or removing addons requires the Admin role on the project.
What's a connection string? It's a single line of text, like a web address, that bundles your database or Redis instance's location, username, and password into one string, so a tool can connect without you typing each piece separately. Treat it like a password: anyone who has it can read and write your data.
Do I need to copy it? No. Your deployed app already has it. The address in it only works inside EthioDeploy, between your app and the addon, so it won't connect from your own computer. To look at or change data without leaving the dashboard, use the project's Database tab (Postgres and MySQL) or Redis tab.
To see the string anyway: open the project's Addons tab and click Reveal next to the addon, or the copy icon to copy it. Only Admins can reveal or copy connection strings.
App containers have no persistent disk: a file your app writes to its own folder, like an uploaded avatar, is gone after the next deploy. The object storage addon gives the project an S3-compatible bucket that keeps them. It's on Pro (10 GB) and Business (50 GB). Adding it sets five env vars; redeploy so the running app gets them:
S3_ENDPOINT=https://<account>.r2.cloudflarestorage.com S3_BUCKET=ed-<id> S3_REGION=auto S3_ACCESS_KEY_ID=... S3_SECRET_ACCESS_KEY=...
Any S3 client works. With the AWS SDK for JavaScript:
import { S3Client, PutObjectCommand, GetObjectCommand } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
const s3 = new S3Client({
region: process.env.S3_REGION,
endpoint: process.env.S3_ENDPOINT,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
},
});
await s3.send(new PutObjectCommand({ Bucket: process.env.S3_BUCKET, Key: "avatars/1.png", Body: file }));
// Files are private: hand out a link that expires.
const url = await getSignedUrl(s3, new GetObjectCommand({ Bucket: process.env.S3_BUCKET, Key: "avatars/1.png" }), { expiresIn: 3600 });In Python, pass the same values to boto3.client("s3", endpoint_url=..., region_name="auto"). In Laravel, point the s3 disk's key, secret, region, bucket and endpoint at these variables.
To upload straight from the browser with a presigned PUT URL, add your site's origin under Browser uploads (CORS) on the addon card. Each plan also caps requests per calendar month (Pro: 500,000 writes and 5 million reads). Over the storage or write cap, the bucket turns read-only: reads keep working, uploads fail until usage drops or the month resets. On a downgrade to Free the bucket stays readable for 90 days, then it's deleted. Removing the addon deletes every file in it.
To use psql, pg_dump, pg_restore, or a GUI client like pgAdmin or TablePlus, turn on external access: on the Addons tab, click Turn on external access on the Postgres card. A second connection string appears under it, pointing at <id>.db.ethiodeploy.app:5432. Reveal or copy it the same way. Only Admins can turn it on.
sslmode=require, so most clients need nothing extra. In a GUI client, set SSL mode to require if it asks.DATABASE_URL. Turning external access on or off never changes it or needs a redeploy.MySQL and Redis addons don't offer external access yet. Use the Database or Redis tab for those.
To move an existing database in without any tools, export it to a file (mysqldump or phpMyAdmin for MySQL, pg_dump for Postgres), then open the project's Database tab, go to Backups, and use Import a SQL file. It takes .sql and .sql.gz files, and pg_dump -Fc dumps for Postgres, up to 500 MB after compression. Plain SQL is compressed in your browser before it uploads. Only Admins can import.
CREATE DATABASE, USE, \connect, and MySQL DEFINER clauses.For files over 500 MB, or if you prefer your own tools: turn on external access, copy the external connection string, then restore your dump into it from your own computer. For a .dump file (made with pg_dump -Fc):
pg_restore --no-owner --no-acl -d "<external connection string>" yourdb.dump
For a plain .sql file:
psql "<external connection string>" -f yourdb.sql
--no-owner --no-acl skips the original server's roles, which don't exist here. Restoring into a database that already has tables? Take a snapshot on the Backups tab first, and add --clean --if-exists to replace what's there. Turn external access off again when the restore finishes.
Join the EthioDeploy Telegram
Release notes as they ship, plus deploy help from the team and other developers.