···11---
22date: "2017-07-21T12:00:00+02:00"
33-title: "Run as service in Linux"
33+title: "Run as a Linux service"
44slug: "linux-service"
55sidebar_position: 40
66toc: false
···1515 identifier: "linux-service"
1616---
17171818-### Run Gitea as Linux service
1818+# Run as a Linux service
19192020-You can run Gitea as service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification).
2020+You can run Gitea as a Linux service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification).
21212222-#### Using systemd
2222+## Using systemd
23232424Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
2525···4141sudo systemctl enable gitea --now
4242```
43434444-#### Using supervisor
4444+## Using supervisor
45454646Install supervisor by running below command in terminal:
4747
···11---
22date: "2016-12-21T15:00:00-02:00"
33-title: "Register as a Windows Service"
33+title: "Register as a Windows service"
44slug: "windows-service"
55sidebar_position: 50
66toc: false
···1414 sidebar_position: 50
1515 identifier: "windows-service"
1616---
1717+# Register as a Windows service
17181818-# Prerequisites
1919+## Prerequisites
19202021The following changes are made in C:\gitea\custom\conf\app.ini:
2122···27282829COMPUTERNAME is whatever the response is from `echo %COMPUTERNAME%` on the command line. If the response is `USER-PC` then `RUN_USER = USER-PC$`
29303030-## Use absolute paths
3131+### Use absolute paths
31323233If you use SQLite3, change the `PATH` to include the full path:
3334···3637PATH = c:/gitea/data/gitea.db
3738```
38393939-# Register as a Windows Service
4040+## Register Gitea
40414142To register Gitea as a Windows service, open a command prompt (cmd) as an Administrator,
4243then run the following command:
···5152"Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port
5253that was configured).
53545454-## Service startup type
5555+### Service startup type
55565657It was observed that on loaded systems during boot Gitea service may fail to start with timeout records in Windows Event Log.
5758In that case change startup type to `Automatic-Delayed`. This can be done during service creation, or by running config command
···6061sc.exe config gitea start= delayed-auto
6162```
62636363-## Adding startup dependencies
6464+### Adding startup dependencies
64656566To add a startup dependency to the Gitea Windows service (eg Mysql, Mariadb), as an Administrator, then run the following command:
6667···70717172This will ensure that when the Windows machine restarts, the automatic starting of Gitea is postponed until the database is ready and thus mitigate failed startups.
72737373-## Unregister as a service
7474+## Unregister Gitea
74757575-To unregister Gitea as a service, open a command prompt (cmd) as an Administrator and run:
7676+To unregister Gitea as a Windows service, open a command prompt (cmd) as an Administrator and run:
76777778```
7879sc.exe delete gitea