2025-10-15 10:43:13 +02:00
2025-10-15 08:20:59 +02:00
2025-10-06 13:32:17 +02:00
2025-10-15 10:43:13 +02:00

Gitea for Ubuntu 24.04 Server

OS Shell WebServer DB Server License

Automated Bash installer script for deploying Gitea on Ubuntu 24.04 Server.

Prerequisites

Nginx as well as MariaDB. Nginx can be installed from here and MariaDB from here.

Note

If you plan to install multiple instances of Gitea, use the script located here.

Download the Script

git clone https://git.x-files.dk/web-application/gitea-ubuntu.git

Usage

cd gitea-ubuntu
sudo ./giteainstall [-n] <domain name> [-p] <gitea database password>

Example

sudo ./giteainstall -n git.something.xyz -p giteadatabasepwd

This will create a Gitea site running on port 80 with the domain name you chose during installation. If you want to configure Nginx to run this on port 443, see the example here. Make sure to also update /etc/gitea/app.ini (change http to https) and then restart both Nginx and Gitea.

Configuration

Once the script is done, browse to:

http://git.something.xyz

and fill out the mandatory fields marked in green.

Gitea Configuration

Post-install

Run the following to adjust app.ini after the initial setup (since the file is created only after setup is complete):

sudo /tmp/gitea-postinstall

Notes

  • SSH will be disabled after running postinstall. You can modify this in /etc/gitea/app.ini.
  • Custom assets (favicon, logo) must be placed in: /var/lib/gitea/custom/public/assets/img/
  • To serve a custom splash page, create home.tmpl and place it in: /var/lib/gitea/custom/templates/

Troubleshooting

Most issues are likely due to differences in Nginx configuration. If you encounter problems, compare with the Nginx configuration I use here and the default sites-enabled config here.

Q and A

Q: Why does the script need the MariaDB root password?
A: To create the Gitea database and set the correct permissions.

More guides can be found on wiki.x-files.dk

Description
No description provided
Readme MIT 89 KiB
Languages
Shell 100%