---
title: "Setting Up Gitea on Ubuntu 20.04 with Docker: A Step by Step Guide - CloudBlast"
description: "Setting Up Gitea on Ubuntu 20.04 with Docker: A Step by Step Guide"
url: "https://cloudblast.io/de/article/Setting-Up-Gitea-on-Ubuntu-20.04-with-Docker:-A-Step-by-Step-Guide"
language: "de-DE"
---

BLOG

# Setting Up Gitea on Ubuntu 20.04 with Docker: A Step by Step Guide

5€ GRATISGUTHABEN bei Registrierung

Registrieren Sie sich bei CloudBlast und erhalten Sie 5€ Cloud-Guthaben für die Bereitstellung Ihrer VPS

[5€ gratis sichern](https://console.cloudblast.io/auth/login?ref=2)

-   [Zurück](https://cloudblast.io/de)
-   [Alle Artikel](https://cloudblast.io/de/blog)

2024-07-22

### Setting Up Gitea on Ubuntu 20.04 with Docker: A Step by Step Guide

tutorials

[Als bevorzugte Quelle auf Google hinzufügen](https://www.google.com/preferences/source?q=cloudblast.io)

Gitea is a lightweight, self-hosted Git service similar to GitHub, GitLab, and Bitbucket. This guide will walk you through the process of setting up Gitea on an Ubuntu server using Docker. By the end, you'll have a fully functional Gitea instance ready for use.

**Prerequisites**

Before you start, ensure you have the following:

-   An Ubuntu server with a non-root user with `sudo` privileges.
-   Docker and Docker Compose installed on your server.
-   Basic knowledge of using the command line.

**Step 1: Install Docker and Docker Compose**

If you haven't already, you'll need to install Docker and Docker Compose. Follow these steps to get both installed:

1.  Update your package list:

    > sudo apt update

       2. Install Docker:

> sudo apt install docker.io

       3. Start and enable Docker:

> sudo systemctl start docker
> sudo systemctl enable docker

       4. Install Docker Compose:

> sudo apt install docker-compose

**Step 2: Create a Directory for Gitea**

Create a directory to hold Gitea's data and configuration files. This helps in managing Gitea's data persistently.

> mkdir -p ~/gitea/{data,config}

**Step 3: Set Up Docker Compose**

Create a `docker-compose.yml` file in the Gitea directory to define the Gitea service.

> nano ~/gitea/docker-compose.yml

Paste the following content into the file:

> version: "3"
>
> services:
>   server:
>     image: gitea/gitea:latest
>     environment:
>       - USER\_UID=1000
>       - USER\_GID=1000
>     volumes:
>       - ./data:/data
>       - ./config:/etc/gitea
>     ports:
>       - "3000:3000"
>       - "222:22"
>     restart: always

Save and close the file.

**Step 4: Launch Gitea**

Navigate to the Gitea directory and launch the Gitea service using Docker Compose:

> cd ~/gitea
> sudo docker-compose up -d

This command will download the Gitea image and start the service in detached mode.

**Step 5: Configure Gitea**

Open your web browser and navigate to `http://your_server_ip:3000` to access the Gitea web installer.

1.  **Database Type**: Select `SQLite3` for simplicity.
2.  **Path**: Ensure the path is `/data/gitea.db`.
3.  **Gitea Admin Account**: Create your initial admin user account by filling in the required details.

Click on the "Install Gitea" button to complete the setup.

**Step 6: Secure Gitea (Optional)**

To secure your Gitea instance, consider the following steps:

-   Enable HTTPS: Use a reverse proxy like Nginx with a Let's Encrypt certificate.
-   Configure SSH: Change the default SSH port to something other than `222` for added security.

**Conclusion**

You've successfully set up Gitea on Ubuntu using Docker. You now have a self-hosted Git service that you can use for your projects.

Teilen

## Weiterlesen

[2026-07-25 How to Install and Set Up Mailcow on Ubuntu and Debian VPS tutorials](https://cloudblast.io/article/how-to-install-and-setup-mailcow-on-ubuntu-and-debian-vps)

[2026-07-25 How to Install Chatwoot on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-chatwoot-on-ubuntu-and-debian-server)

[2026-07-25 How to Install Mattermost on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-mattermost-on-ubuntu-and-debian-server)

[2026-07-25 How to Install RustDesk on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-rustdesk-on-ubuntu-and-debian-server)
