Skip to main content

Memos with Docker Compose

Memos runs on SQLite by default and on MySQL or PostgreSQL when you set MEMOS_DRIVER and MEMOS_DSN. The compose file below uses MySQL, which is what the one-click template provisions; drop the db service and both environment variables to run the SQLite single-container version instead.

Before using the one-click template, here is a minimal Docker Compose file for self-hosting Memos.

If you're new to Docker Compose, check out our guide on how to self-host a Docker Compose app. You can also browse more examples in our Docker Compose library.

Self-host Memos with Docker Compose (minimal)​

services:
memos:
image: usememos/memos:latest
ports:
- "5230:5230"
environment:
MEMOS_DRIVER: mysql
MEMOS_DSN: memos:memospass@tcp(db:3306)/memos


db:
image: mysql:8
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: memos
MYSQL_USER: memos
MYSQL_PASSWORD: memospass
volumes:
- dbdata:/var/lib/mysql

volumes:
dbdata:

Deploy Memos on Hostim.dev (one-click)​

Memos is a self-hosted, minimalist note-taking app – like a lightweight Notion or personal wiki. With Hostim.dev, you can deploy Memos with Docker, MySQL, persistent storage, and HTTPS in under a minute.

📝 Take notes. Self-host them. Share anywhere – without setting up a server.

Try it Yourself

Guest project runs for 1 hour. Log in to save and extend to 5 days.

Why Host Memos on Hostim.dev?​

  • One-click Docker deployment
  • Built-in MySQL
  • Instant HTTPS + domain
  • Real-time logs & metrics
  • Persistent storage for all notes

What's included​

ResourceDetails
Appusememos/memos image
DatabaseMySQL (auto-provisioned)
DomainFree *.hostim.dev subdomain
SSLLet’s Encrypt (auto-enabled)
Port5230

How to Deploy​

  1. Go to your Hostim.dev dashboard.
  2. Click Create Project → Use a Template.
  3. Select Memos.
  4. Choose a resource plan.
  5. Deploy.

Frequently asked questions

Does Memos require MySQL?

No. Memos defaults to an embedded SQLite database and needs no separate database container. MySQL and PostgreSQL are supported alternatives, selected by setting MEMOS_DRIVER and MEMOS_DSN. The Hostim template uses MySQL so the database is managed and backed up separately from the app.

What is the minimal docker-compose.yml for Memos?

One service running usememos/memos:latest with port 5230 published and a volume mounted at /var/opt/memos is enough for the SQLite setup. For MySQL, add a mysql:8 service and set MEMOS_DRIVER=mysql and MEMOS_DSN=user:password@tcp(db:3306)/memos on the Memos container.

Where does Memos store notes and attachments?

In whichever database MEMOS_DRIVER points at. With the default SQLite driver that is a file inside the Memos data volume; with the MySQL driver both the notes and the uploaded attachments live in the MySQL database, so backing up MySQL backs up everything.

How do I set the Memos database connection?

Set two environment variables: MEMOS_DRIVER to sqlite, mysql or postgres, and MEMOS_DSN to the connection string for that driver. The MySQL form is user:password@tcp(host:3306)/database. On Hostim both are edited under Environment Variables and the app restarts with the new values.

How do I back up Memos?

Back up the database that MEMOS_DRIVER selects. For MySQL take a mysqldump of the Memos database; on Hostim that runs through the Bastion host. For SQLite, copy the database file out of the data volume.

Can I use a custom domain with Memos?

Yes. On Hostim, add the domain under Networking then Domains, and the certificate is issued automatically. Self-hosted with Compose, put a reverse proxy in front of port 5230 and terminate TLS there.

How do I update Memos?

Run docker compose pull and then docker compose up -d to move to the newest usememos/memos image. On Hostim, redeploy the app. Data is in the database, not the image, so it survives the update.

Why can't I log in to Memos?

Almost always the database connection. Check that the database container is running and that MEMOS_DSN matches its user, password, host and database name. The first account created after a fresh install becomes the host account, so a rebuilt empty database will ask you to sign up again.


Alternatives​

  • Actual — lightweight personal knowledge manager
  • Logseq — open-source notes with graph view
  • Joplin Server — sync backend for Joplin notes

Source + Docs​


Looking for something else? Browse all templates →


Try it now​

Deploy Memos Now – in less than 60 seconds