Docker Compose
This guide shows you how to deploy a self-hosted instance of Micro using Docker Compose.
Prerequisites
You'll need a server with:
- Docker and Docker Compose
Installation
Create a new directory and navigate to it:
mkdir micro
cd microCreate a docker-compose.yml file:
volumes:
database:
assets:
services:
database:
container_name: database
image: postgres:17-alpine
restart: unless-stopped
volumes:
- database:/var/lib/postgresql/data
environment:
POSTGRES_USER: micro
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: micro
healthcheck:
test: ["CMD", "pg_isready", "-U", "micro", "-d", "micro"]
interval: 5s
timeout: 5s
retries: 10
micro:
container_name: micro
image: codeberg.org/nord-studio/micro:latest
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./config.toml:/app/config.toml
- assets:/app/assets
environment:
- DATABASE_URL=postgresql://micro:${POSTGRES_PASSWORD}@database:5432/micro
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://127.0.0.1:3000/api/health"]
interval: 30s
timeout: 5s
start_period: 60s
retries: 3
depends_on:
database:
condition: service_healthyGenerate a .env file with a database password:
echo "POSTGRES_PASSWORD=$(openssl rand -hex 32)" > .envAdd any other environment variables here and pass them to the micro service.
Create a config.toml file:
origin = "http://localhost:3000"
[auth.passkeys]
enabled = true
[assets.local]
enabled = trueSet origin to your instance's URL. Passkeys won't work otherwise.
Start the containers:
docker compose up -dMicro runs its database migrations on startup.
Go to your server's address on port 3000 to create your account and first workspace.