Skip to content

Instantly share code, notes, and snippets.

@mngshm
Last active October 30, 2024 14:23
Show Gist options
  • Save mngshm/a0edb097c91d1dc45aeed755af310323 to your computer and use it in GitHub Desktop.
Save mngshm/a0edb097c91d1dc45aeed755af310323 to your computer and use it in GitHub Desktop.
How to run Museum as a systemd service

Run Museum as a Systemd Service.

This is a guide on how to run Museum as a systemd server without docker's intervention.

Below is the systemd.service content copy paste this into /etc/systemd/system/ directory inside a new .service file.

[Unit]
Description=Running Museum as a background service.

[Service]
Type=simple
Restart=always
WorkingDirectory=/path/to/ente/server
Environment=GO111MODULE=on
Environment=GOPATH=/path/to/gopath
Environment=GOCACHE=/path/to/go-cache/
Environment=GOMODCACHE=/path/to/go-mod-cache
Environment=ENTE_DB_USER=postgres
ExecStart=go run cmd/museum/main.go

[Install]
WantedBy=multi-user.target

Please change the path in the above Environment variables accordingly, you can find the exact path's by executing go env in your terminal.

And you're good to go by executing

sudo systemctl daemon-reload && sudo systemctl enable museum.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment