Docker Compose on Linux
This is the reference setup: Docker Compose on any Linux machine. The commands are for Debian and Ubuntu; on other distributions only the Docker installation differs.
-
Install Docker. Follow Docker’s own guide for your distribution, which also installs the Compose plugin: Debian, Ubuntu, Fedora. Then check:
Terminal window docker compose versionOptional, so you don’t need
sudofor every Docker command:sudo usermod -aG docker $USER, then log out and in. -
Make a folder for the site and download the files.
Terminal window sudo mkdir -p /opt/3mf-library && sudo chown $USER /opt/3mf-librarycd /opt/3mf-librarycurl -fsSLO https://raw.githubusercontent.com/jurjen74/3mf-library/main/docker-compose.ymlcurl -fsSLO https://raw.githubusercontent.com/jurjen74/3mf-library/main/compose.nfs.ymlcurl -fsSL -o .env https://raw.githubusercontent.com/jurjen74/3mf-library/main/.env.exampleYou can also
git clone https://github.com/jurjen74/3mf-library.gitand use the files from the clone. -
Find out who owns your models. The container runs as one user, which must be able to read them:
Terminal window ls -ln /srv/3d-prints | head # columns 3 and 4: user id and group idid # your own user id and group id -
Edit
.env. At least:Terminal window LIBRARY_DIR=/srv/3d-printsPUID=1000 # from step 3PGID=1000TRUSTED_NETWORKS=192.168.1.0/24 # your home network; empty = everyone logs inTZ=Europe/AmsterdamModels on a NAS? Leave
LIBRARY_DIRand set up NFS instead. All settings: Configuration. -
Create the data folder for that user:
Terminal window mkdir -p data && sudo chown 1000:1000 data # your PUID:PGID -
Start it and watch the first scan:
Terminal window docker compose up -ddocker compose logs -fA line like
Scan finished in 42.0s: 812 files in 96 foldersmeans it’s done.Ctrl+Cstops watching, not the site. -
Open the site at
http://<server address>:8085and create the first account.
Firewall
Section titled “Firewall”If the machine runs a firewall, allow port 8085 from your home network only. With ufw:
sudo ufw allow from 192.168.1.0/24 to any port 8085 proto tcpDocker’s published ports bypass ufw rules on many systems. To be safe, don’t forward 8085 on your router, and use a
reverse proxy for access from outside.
It starts by itself
Section titled “It starts by itself”restart: unless-stopped brings the container back after a reboot, as long as Docker itself starts at boot (it does
by default; sudo systemctl enable docker to be sure).
Everyday commands
Section titled “Everyday commands”cd /opt/3mf-librarydocker compose logs --tail 50 # what's going ondocker compose pull && docker compose up -d && docker image prune -f # updatedocker compose restart # after changing .env: use "up -d" insteaddocker compose down # stop and remove the container (data stays)Uninstall
Section titled “Uninstall”cd /opt/3mf-library && docker compose downdocker image rm ghcr.io/jurjen74/3mf-library:latestsudo rm -rf /opt/3mf-library # removes accounts and previews; your models are untouched