Are you looking to set up a lightweight, self-hosted Git server? Gitea might just be the tool you need. It’s fast, easy to use, and perfect for personal projects or small teams. Best of all, it won’t eat up your system resources.
With Debian 13 offering a robust and stable environment, it’s an ideal platform for your Gitea installation. In just a few simple steps, you can have your own Git service running smoothly. Whether you’re a curious developer or someone ready to manage their code more efficiently, this guide will walk you through the entire process.
Get ready to simplify your version control operations and enhance collaboration without the hassle!
Prerequisites for Installing Gitea on Debian 13
Before diving into the installation process, let’s ensure you’re all set with a few prerequisites. Having these in place ensures a smooth installation experience and optimal performance.
System Requirements
To get started, you’ll need a server running Debian 13. While Gitea is minimalistic in resource usage, having at least 512 MB of RAM and a single CPU core will keep things running efficiently. Ensure you have sufficient disk space for your repositories, as well.
Installing Dependencies
First off, you need to update your system’s package index. Open the terminal and run:
sudo apt updateGitea requires a few dependencies to run smoothly. These include Git, the SQLite or MySQL/MariaDB database, and optional tools like wget. Install these by executing:
sudo apt install git wgetAnd if you’re opting for SQLite (for simplicity), add it as well:
sudo apt install sqlite3Having these dependencies in place sets the foundation for a successful Gitea installation on Debian 13. Now you’re ready to move on to the installation steps, ensuring your server is primed and ready for action!
Downloading Gitea on Debian 13
With your prerequisites sorted, it’s time to download Gitea. The process is straightforward, and you’ll have a working setup in no time.
Start by navigating to the official Gitea website to find the latest release. The easiest way to do this is by using the terminal. Execute the following command to fetch the latest version of Gitea:
wget -O gitea https://dl.gitea.io/gitea/1.18.0/gitea-1.18.0-linux-amd64Make sure to replace 1.18.0 with the version number you need if a newer version is available.
Once downloaded, set the file permissions so it’s executable:
chmod +x giteaAt this stage, you’ll want to move Gitea to a directory in your PATH so you can run it easily from anywhere. A common location is /usr/local/bin:
sudo mv gitea /usr/local/bin/There you have it—Gitea is downloaded and ready to be set up. Time to roll into configuration mode!
Configuring Gitea on Debian 13
With Gitea downloaded, let’s dive into configuring it to suit your needs. Getting the initial setup just right ensures a seamless start to your Git journey.
Initial Setup
First, create a dedicated Gitea user to run the application, keeping it secure and organized:
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/gitea giteaNext, make sure to create essential directories for Gitea:
sudo mkdir -p /var/lib/gitea/{custom,data,log}
sudo chown -R gitea:gitea /var/lib/gitea/To ensure these directories persist across reboots, secure them with the correct permissions:
sudo chmod -R 750 /var/lib/gitea/Database Configuration
Gitea supports several database systems, including SQLite, MySQL, and PostgreSQL. If you opted for SQLite, you’re ready to go since it’s a file-based database system.
For MySQL or PostgreSQL, create a database and user:
- MySQL
mysql -u root -p CREATE DATABASE gitea CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'; CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'your-password'; GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost'; - PostgreSQL
sudo -u postgres psql CREATE DATABASE gitea; CREATE USER gitea WITH PASSWORD 'your-password'; GRANT ALL PRIVILEGES ON DATABASE gitea TO gitea;
With your database in place, you’re ready to launch into Gitea’s web setup to finalize configuration details. Let the fun begin!
Starting and Enabling Gitea Service
With Gitea installed and configured, it’s time to set it in motion. First, create a systemd service file to manage Gitea as a service. Open an editor and create the file with:
sudo nano /etc/systemd/system/gitea.serviceIn this file, enter the necessary configurations:
[Unit]
Description=Gitea
After=network.target
[Service]
ExecStart=/usr/local/bin/gitea web
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
Restart=always
Environment=USER=gitea HOME=/var/lib/gitea
[Install]
WantedBy=multi-user.targetSystem Service Configuration
After saving and closing the file, enable and start the Gitea service to ensure it runs on startup. Execute the following commands:
sudo systemctl enable gitea
sudo systemctl start giteaThese commands configure Gitea to launch automatically every time the system boots, ensuring uptime.
Verifying Installation
Now that Gitea is running, it’s time to confirm everything is set correctly. Check the service status with:
sudo systemctl status giteaYou should see Gitea active and running. Next, visit http://your-server-ip:3000 in your web browser. If the Gitea web interface appears, congratulations! Your Gitea installation on Debian 13 is complete and ready for use.

Conclusion
And there you have it! You’ve successfully set up Gitea on Debian 13, transforming your server into a compact yet powerful Git service. With its user-friendly interface and efficient performance, Gitea is now at your fingertips, ready to manage repositories and foster collaboration.
Whether you’re using it for personal projects or within a small team, Gitea delivers flexibility without demanding heavy resources. Plus, being self-hosted means you have full control over your code and data.
Enjoy exploring all the features Gitea offers, from pull requests to issue tracking. Happy coding!




