Skip to content

Instantly share code, notes, and snippets.

@HorlogeSkynet
Last active April 14, 2026 19:15
Show Gist options
  • Select an option

  • Save HorlogeSkynet/81a3a4ff2ea342dc3a77dc038cbc0e35 to your computer and use it in GitHub Desktop.

Select an option

Save HorlogeSkynet/81a3a4ff2ea342dc3a77dc038cbc0e35 to your computer and use it in GitHub Desktop.
systemd unit service for Gitea server running against Redis
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
Wants=redis-server.service
Requires=redis-server.service
[Service]
User=git
WorkingDirectory=/var/lib/gitea/
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
# From <https://github.com/go-gitea/gitea/issues/13015#issuecomment-702739005>
ExecStop=/usr/local/bin/gitea manager --config /etc/gitea/app.ini flush-queues
ExecStop=/usr/local/bin/gitea manager --config /etc/gitea/app.ini shutdown
RestartSec=2s
Restart=always
# Security options override moved to :
# <https://github.com/HorlogeSkynet/systemd-hardene.d/blob/master/collection/gitea.service.d/00-hardened.conf>
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment