This is a simple docker/podman-compose setup with images for running various sourcehut services. It's honestly just easier to use an Alpine VM, but if you want containers feel free to use this. You can send me patches if you really want to.
I use podman, if you use docker just s/podman/docker/ when following these instructions.
Clone all of the sourcehut services into named folders, and build all of the
make. They can also be built automatically by podman-compose
but I prefer this method.
add to /etc/hosts: 127.0.0.1 meta.sr.ht.local 127.0.0.1 git.sr.ht.local 127.0.0.1 todo.sr.ht.local 127.0.0.1 paste.sr.ht.local 127.0.0.1 todo.sr.ht.local
If you're using podman or another unprivileged container runtime, run
this command to allow nginx to bind to port 80:
sudo sysctl net.ipv4.ip_unprivileged_port_start=80
In the folder etcsrht (which is mounted as /etc/sr.ht in the
containers), put a config.ini file edited for all of the services you
want to run. Your PostgreSQL connection strings should look like
postgresql://postgres@db/paste.sr.ht, and your Redis strings should
Setup the PostgreSQL database for each service. In short, using meta.sr.ht as an example:
podman exec -it sourcehut-compose_db_1 psql -U postgres
CREATE DATABASE "meta.sr.ht";
podman exec -it sourcehut-compose_meta_1 sh
from metasrht.app import db
At this point meta.sr.ht.local should be working. If not, check the logs
podman logs sourcehut-compose_whatever_1, and/or sob into your
hands. Follow the instructions in the official man.sr.ht installation
guide for creating an OAuth token for each service and setting it to
These configuration files are released into the public domain under the terms of Creative Commons Zero 1.0 Universal.