This directory contains an example deployment for micro. It uses docker and cloudflare tunnel to deploy it anywhere.
Note
If you need help, join the discord server. This guide assumes you are on linux with a basic understanding of linux and docker.
Important
This guide assumes you have installed docker and cloudflare tunnel. It also assumes you have basic knowledge of them. If you are stuck or discover problems with this guide, ask in the discord server or look at other guides for discord/cloudflare tunnel.
- Clone the example to a local directory
- Fill out
micro.yaml
, each option is documented in the file. Most importantly, make suresecret
is changed. - Replace the postgresql password in
compose.yaml
with a secure password. - Setup the tunnel
docker compose exec tunnel cloudflared tunnel login
docker compose exec tunnel cloudflared tunnel create micro
- You will get a tunnel ID that looks like
168b9890-caa1-44c1-822b-12cf1a5e361e
, copy it and replaceYOUR_TUNNEL_ID
intunnel.yaml
with it. - Replace the
example.net
domain with your own domain intunnel.yaml
.
- Start micro with
docker compose up -d
- Run
docker compose logs micro
, the initial startup will log an invite link. Go to it and setup the first account, which is given admin permissions automatically.
Tip
Consider swapping cloudflare tunnel for something else. It's used in this example for convenience as it works behind NATs and firewalls and provides automatic SSL. You might prefer using Caddy, nginx, traefik, or something else in its place.
All the configuration options are listed in the example config file. venera is used to load configs, which are validated at startup and may log errors if an invalid configuration is detected. The venera page has detailed information, but tl;dr:
.microrc.yaml
is the main configuration file.- You can override any config value with an environment variable. The key
hosts.0.url
would be set asMICRO_HOSTS__0__URL
- You can use other file formats, like JSON or TOML.
You should take a full database backup before updating, but you won't, will you? The database will be automatically migrated on startup, all you have to do is run a newer version of micro.
docker compose pull micro
docker compose up -d micro
Updating postgres is an involved process. Google will have better information. In general, you will want to do something like this:
- Export your database to a
.sql
file, using something likedocker compose exec postgres pg_dump -U postgres -d micro > backup.sql
- Stop your database
- Rename the database directory to something else, like
mv ./data ./data-old
- Update
compose.yaml
to point to the new postgres version, for examplepostgres:16-alpine
is for v16 of postgres. - Start the database
docker compose up -d postgres
- Restore the database using the
.sql
file - Once it all checks out, you can delete the old database directory if you are confident you won't need it.