Gitea - run as systemd service in Ubuntu 16.04 LTS
Gitea is a community managed fork of Gogs.
Run below command in terminal:
sudo vim /etc/systemd/system/gitea.service
Add the following code to the file:
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
After=mysql.service
#After=postgresql.service
#After=memcached.service
#After=redis.service
[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=simple
User=git
Group=git
WorkingDirectory=/home/git/gitea
ExecStart=/home/git/gitea/gitea web -p PORT
Restart=always
Environment=USER=git HOME=/home/git
[Install]
WantedBy=multi-user.target
Uncomment any service need to be enabled like mysql in this case in Unit section.
Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p
flag if default port is used.
Lastly start and enable gitea at boot:
sudo systemctl start gitea
sudo systemctl enable gitea
And that will be it.