{"id":7377,"date":"2018-11-30T12:57:45","date_gmt":"2018-11-30T09:57:45","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/install-gitea-using-docker-on-ubuntu\/"},"modified":"2018-11-30T12:57:45","modified_gmt":"2018-11-30T09:57:45","slug":"how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04\/","title":{"rendered":"How to Install Gitea Self-hosted Git Service using Docker on Ubuntu 18.04"},"content":{"rendered":"<p>Gitea is a fork of Gogs, the\u00a0easy to use self-hosted Git service. It is similar to GitHub, Bitbucket, and Gitlab. Gitea is lightweight code hosting solution written in Go, can run on minimal hardware requirements. It is a cross-platform application, can run anywhere Go can be compiled such as Windows, Linux, MacOS, ARM etc.<\/p>\n<p>In this tutorial, I will show you step-by-step how to install and configure the lightweight Git service using Gitea. We will deploy the Gitea server using Docker and will be using the PostgreSQL database and Traefik Reverse proxy. For this guide, we will be using the latest Ubuntu 18.04 Server.<\/p>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ul>\n<li>Ubuntu 18.04<\/li>\n<li>Root privileges<\/li>\n<\/ul>\n<h2 id=\"what-we-will-do\">What we will do?<\/h2>\n<ol>\n<li>Install Docker-CE<\/li>\n<li>Install Docker Compose<\/li>\n<li>Deploy Gitea as Container using Docker<\/li>\n<li>Gitea Post-Installation<\/li>\n<li>Create First Repository<\/li>\n<li>Testing First Commit<\/li>\n<\/ol>\n<h2 id=\"step-install-dockerce\">Step 1 &#8211; Install Docker-CE<\/h2>\n<p>The first step we will do for this guide is to install the Docker community edition to the Ubuntu 18.04 server. We will install the Docker CE package from the official Docker repository.<\/p>\n<p>Add the Docker and Docker repository by running commands below.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -<br\/>sudo add-apt-repository \\<br\/>\u00a0\u00a0 \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\<br\/>\u00a0\u00a0 $(lsb_release -cs) \\<br\/>\u00a0\u00a0 stable\"<\/code><\/pre>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04.png\" alt=\"Add Docker Ubuntu Repository\" width=\"500\" height=\"203\" title=\"\"><\/a><\/p>\n<p>The &#8216;add-apt-repository&#8217; command will automatically update the repository.<\/p>\n<p>Now install the Docker CE package.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo apt policy docker-ce<br\/>sudo apt install docker-ce=18.06.1~ce~3-0~ubuntu<\/code><\/pre>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-1.png\" alt=\"install the Docker CE package\" width=\"500\" height=\"341\" title=\"\"><\/a><\/p>\n<p>When the installation is complete, start the docker service and enable it to launch everytime at system boot.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo systemctl start docker<br\/>sudo systemctl enable docker<\/code><\/pre>\n<p>Docker CE is up and running on the Ubuntu 18.04 server. Verify the installation by checking the docker version.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker version<\/code><\/pre>\n<p><a class=\"fancybox\" id=\"img-3\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-2.png\" alt=\"Check Docker version\" width=\"500\" height=\"313\" title=\"\"><\/a><\/p>\n<p>or run the docker &#8216;hello-world&#8217;.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker run hello-world<\/code><\/pre>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-3.png\" alt=\"docker run hello-world\" width=\"500\" height=\"424\" title=\"\"><\/a><\/p>\n<h2 id=\"step-install-docker-compose\">Step 2 &#8211; Install Docker Compose<\/h2>\n<p>Docker-Compose is a command line tool for defining and managing multi-container docker applications. It allows you to create a container as a service, great for your development, testing and staging environment.<\/p>\n<p>Install Docker Compose by downloading the binary file and make it an executable.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo curl -L https:\/\/github.com\/docker\/compose\/releases\/download\/1.22.0\/docker-compose-$(uname -s)-$(uname -m) -o \/usr\/local\/bin\/docker-compose<br\/>sudo chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<p>Now check the docker-compose command.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker-compose version<\/code><\/pre>\n<p>Docker Compose is now installed.<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-4.png\" alt=\"Install Docker Compose\" width=\"500\" height=\"108\" title=\"\"><\/a><\/p>\n<h2 id=\"step-deploy-gitea-as-docker-container\">Step 3 &#8211; Deploy Gitea as Docker Container<\/h2>\n<p>In this step, we will create a new docker-compose script that contains all services configuration including PostgreSQL Database and Traefik reverse proxy. We will set up all deployment files on the directory named &#8216;deployment&#8217;.<\/p>\n<h3 id=\"create-custom-docker-network\">Create Custom Docker Network<\/h3>\n<p>Before creating the deployment configuration, let&#8217;s create a new custom bridge network. It will be used for the external service traefik reverse proxy.<\/p>\n<p>Check the list docker network.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker network ls<\/code><\/pre>\n<p>Now create a new custom bridge network named &#8216;hakasenet&#8217;.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker network create hakasenet<\/code><\/pre>\n<p>Check it again.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker network ls<\/code><\/pre>\n<p>Now you will get &#8216;hakasenet&#8217; network on the list.<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-5.png\" alt=\"Check docker network\" width=\"500\" height=\"276\" title=\"\"><\/a><\/p>\n<h3 id=\"setup-deployment-directory-and-files\">Setup Deployment Directory and Files<\/h3>\n<p>Create a new directory named &#8216;deployment&#8217; and the &#8216;docker-compose.yml&#8217; script on it.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">mkdir deployment; cd deployment<br\/>touch docker-compose.yml<\/code><\/pre>\n<p>Now create new directory &#8216;gitea&#8217; and &#8216;postgres&#8217; data volume.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">mkdir -p gitea\/ postgres\/<\/code><\/pre>\n<p>Create a new file &#8216;acme.json&#8217; and change the permission of the file. it will be used to store Letsencrypt data.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">touch acme.json<br\/>chmod 600 acme.json<\/code><\/pre>\n<p>Now create the global traefik configuration &#8216;traefik.toml&#8217; file.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">touch traefik.toml<\/code><\/pre>\n<p>And below are files and directories we&#8217;ve for the Gitea installation using Docker.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">tree<\/code><\/pre>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-6.png\" alt=\"Setup Deployment Directory and Files\" width=\"500\" height=\"306\" title=\"\"><\/a><\/p>\n<h3 id=\"setup-postgresql-service\">Setup PostgreSQL Service<\/h3>\n<p>The database service PostgreSQL is the first service that we want to configure. The database service will run only on the internal docker network.<\/p>\n<p>And we will be using the Postgres 9.6 image, using &#8216;gitea&#8217; as database name, user, and password, and set up the postgres data volume.<\/p>\n<p>Edit the &#8216;docker-compose.yml&#8217; file using <a href=\"https:\/\/www.howtoforge.com\/vim-basics\" target=\"_blank\" rel=\"noopener noreferrer\">vim<\/a>.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">vim docker-compose.yml<\/code><\/pre>\n<p>Paste configurations below.<\/p>\n<pre>version: \"3\"&#13;\n&#13;\nnetworks:&#13; hakasenet:&#13; external: true&#13; internal:&#13; external: false&#13;\n&#13;\nservices:&#13; db:&#13; image: postgres:9.6&#13; restart: always&#13; environment:&#13; - POSTGRES_USER=gitea&#13; - POSTGRES_PASSWORD=gitea&#13; - POSTGRES_DB=gitea&#13; labels:&#13; - \"traefik.enable=false\"&#13; networks:&#13; - internal&#13; volumes:&#13; - .\/postgres:\/var\/lib\/postgresql\/data<\/pre>\n<p>Save and exit.<\/p>\n<h3 id=\"setup-traefik-reverse-proxy\">Setup Traefik Reverse Proxy<\/h3>\n<p>Now we will configure the Traefik reverse proxy for our Gitea installation.<\/p>\n<p>The traefik service will be running under HTTP and HTTPS default ports, running on the custom bridge network named &#8216;hakasenet&#8217;, and we will configure it to use the Letsencrypt certificates that will be defined on the &#8216;traefik.toml&#8217; file.<\/p>\n<p>Edit the compose script.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">vim docker-compose.yml<\/code><\/pre>\n<p>Paste configurations under the db service configuration.<\/p>\n<pre> traefik:&#13; image: traefik:latest&#13; command: --docker&#13; ports:&#13; - 80:80&#13; - 443:443&#13; labels:&#13; - \"traefik.enable=true\"&#13; - \"traefik.backend=dashboard\"&#13; - \"traefik.frontend.rule=Host:traefik.hakase-labs.io\"&#13; - \"traefik.port=8080\"&#13; networks:&#13; - hakasenet&#13; volumes:&#13; - \/var\/run\/docker.sock:\/var\/run\/docker.sock&#13; - .\/traefik.toml:\/traefik.toml&#13; - .\/acme.json:\/acme.json&#13; container_name: traefik&#13; restart: always<\/pre>\n<p>Save and exit.<\/p>\n<p>Now edit the &#8216;traefik.toml&#8217; configuration file.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">vim traefik.toml<\/code><\/pre>\n<p>And paste the following configuration.<\/p>\n<pre>#Traefik Global Configuration&#13;\ndebug = false&#13;\ncheckNewVersion = true&#13;\nlogLevel = \"ERROR\"&#13;\n&#13;\n#Define the EntryPoint for HTTP and HTTPS&#13;\ndefaultEntryPoints = [\"https\",\"http\"]&#13;\n&#13;\n#Define the HTTP port 80 and&#13;\n#HTTPS port 443 EntryPoint&#13;\n#Enable automatically redirect HTTP to HTTPS&#13;\n[entryPoints]&#13;\n[entryPoints.http]&#13;\naddress = \":80\"&#13;\n[entryPoints.http.redirect]&#13;\nentryPoint = \"https\"&#13;\n[entryPoints.https]&#13;\naddress = \":443\"&#13;\n[entryPoints.https.tls]&#13;\n&#13;\n#Enable Traefik Dashboard on port 8080&#13;\n#with basic authentication method&#13;\n#hakase and password&#13;\n[entryPoints.dash]&#13;\naddress=\":8080\"&#13;\n[entryPoints.dash.auth]&#13;\n[entryPoints.dash.auth.basic]&#13; users = [&#13; \"hakase:$apr1$hEgpZUN2$OYG3KwpzI3T1FqIg9LIbi.\",&#13; ]&#13;\n&#13;\n[api]&#13;\nentrypoint=\"dash\"&#13;\ndashboard = true&#13;\n&#13;\n#Enable retry sending a request if the network error&#13;\n[retry]&#13;\n&#13;\n#Define Docker Backend Configuration&#13;\n[docker]&#13;\nendpoint = \"unix:\/\/\/var\/run\/docker.sock\"&#13;\ndomain = \"hakase-labs.io\"&#13;\nwatch = true&#13;\nexposedbydefault = false&#13;\n&#13;\n#Letsencrypt Registration&#13;\n#Define the Letsencrypt ACME HTTP challenge&#13;\n[acme]&#13;\nemail = \"<a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"731b121812001633141e121a1f5d101c1e\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>\"&#13;\nstorage = \"acme.json\"&#13;\nentryPoint = \"https\"&#13;\nOnHostRule = true&#13; [acme.httpChallenge]&#13; entryPoint = \"http\"<\/pre>\n<p>Save and exit.<\/p>\n<p><strong>Note:<\/strong><\/p>\n<ul>\n<li>Change the acme letsencrypt email with your valid email address.<\/li>\n<\/ul>\n<h3 id=\"setup-gitea-service\">Setup Gitea Service<\/h3>\n<p>Edit the &#8216;docker-compose.yml&#8217; configuration file.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">vim docker-compose.yml<\/code><\/pre>\n<p>Paste the gitea service configuration at the bottom of the line.<\/p>\n<pre> server:&#13; image: gitea\/gitea:latest&#13; environment:&#13; - USER_UID=1000&#13; - USER_GID=1000&#13; restart: always&#13; networks:&#13; - internal&#13; volumes:&#13; - .\/gitea:\/data&#13; ports:&#13; - \"3000\"&#13; - \"22\"&#13; labels:&#13; - \"traefik.enabled=true\"&#13; - \"traefik.backend=gitea\"&#13; - \"traefik.frontend.rule=Host:git.hakase-labs.io\"&#13; - \"traefik.docker.network=hakasenet\"&#13; - \"traefik.port=3000\"&#13; networks:&#13; - internal&#13; - hakasenet&#13; depends_on:&#13; - db&#13; - traefik<\/pre>\n<p>Save and exit.<\/p>\n<p>The Gitea service will be running on the TCP port &#8216;3000&#8217;, using those two docker networks &#8216;internal&#8217; and &#8216;hakasenet&#8217;, and will run under the traefik reverse proxy on domain &#8216;git.hakase-labs.io&#8217;.<\/p>\n<p>Docker composes configuration for Gitea deployment has been completed.<\/p>\n<h3 id=\"deploy-all-services\">Deploy All Services<\/h3>\n<p>Now deploy the stack using &#8216;docker-compose&#8217; command below.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker-compose up -d<\/code><\/pre>\n<p>The command will download all docker images needed and run services defined on the docker-compose script.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-7.png\" alt=\"Deploy All Services\" width=\"500\" height=\"301\" title=\"\"><\/a><\/p>\n<p>And when it&#8217;s complete, check available services on docker using ps option as below.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker-compose ps<\/code><\/pre>\n<p>Now you will get the result as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-9\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-8.png\" alt=\"docker-compose ps\" width=\"500\" height=\"141\" title=\"\"><\/a><\/p>\n<p>The PostgreSQL database, Gitea, and traefik reverse proxy containers are now up and running. The database service is running on the default port &#8216;5432&#8217;, the gitea server is running on port &#8216;3000&#8217;, and the traefik proxy is running on HTTP and HTTPS ports, accessible from the outside network\/internet.<\/p>\n<p>If you want to check all logs from docker check, run command below.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">docker-compose logs<\/code><\/pre>\n<p><a class=\"fancybox\" id=\"img-10\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-9.png\" alt=\"docker-compose logs\" width=\"500\" height=\"511\" title=\"\"><\/a><\/p>\n<h2 id=\"step-gitea-postinstallation\">Step 4 &#8211; Gitea Post-Installation<\/h2>\n<p>Open your web browser and type your Gitea URL installation. Mine is:<\/p>\n<p><em><strong>https:\/\/git.hakase-labs.io\/<\/strong><\/em><\/p>\n<p>Now you will get the default Gitea page.<\/p>\n<p><a class=\"fancybox\" id=\"img-19\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/19.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-10.png\" alt=\"Gitea run with Docker\" width=\"500\" height=\"286\" title=\"\"><\/a><\/p>\n<p>Add the installation path to the URL.<\/p>\n<p><em><strong>https:\/\/git.hakase-labs.io\/install<\/strong><\/em><\/p>\n<p>Now you will get the Gitea installation page.<\/p>\n<h3 id=\"database-configuration\">Database configuration<\/h3>\n<p>Type the PostgreSQL database details, and use &#8216;<strong>db<\/strong>&#8216; as a host.<\/p>\n<p><a class=\"fancybox\" id=\"img-11\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-11.png\" alt=\"Gitea web installer\" width=\"500\" height=\"235\" title=\"\"><\/a><\/p>\n<h3 id=\"general-gitea-configuration\">General Gitea Configuration<\/h3>\n<p>Change the &#8216;Site title&#8217; with your own title, the &#8216;SSH Server Domain&#8217; (without https) and &#8216;Gitea Base URL&#8217; with your gitea server URL.<\/p>\n<p><a class=\"fancybox\" id=\"img-12\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-12.png\" alt=\"General Gitea Configuration\" width=\"500\" height=\"287\" title=\"\"><\/a><\/p>\n<h3 id=\"admin-account-settings\">Admin Account Settings<\/h3>\n<p>On the admin settings, type the admin username, password, and email address.<\/p>\n<p><a class=\"fancybox\" id=\"img-13\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-13.png\" alt=\"Admin Account Settings\" width=\"500\" height=\"288\" title=\"\"><\/a><\/p>\n<p>Now click &#8216;Install Gitea&#8217; button.<\/p>\n<p>And you will be redirected to the Gitea default user dashboard.<\/p>\n<p><a class=\"fancybox\" id=\"img-14\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-14.png\" alt=\"Gitea default user dashboard\" width=\"500\" height=\"198\" title=\"\"><\/a><\/p>\n<h2 id=\"step-create-first-repository-in-gitea\">Step 5 &#8211; Create First Repository in Gitea<\/h2>\n<p>On the user home page, click the <strong>&#8216;+&#8217;<\/strong> button.<\/p>\n<p>Now type details of the repository that you want to create.<\/p>\n<p><a class=\"fancybox\" id=\"img-15\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-15.png\" alt=\"Add Repository\" width=\"500\" height=\"287\" title=\"\"><\/a><\/p>\n<p>and click the &#8216;Create Repository&#8217; button.<\/p>\n<p>The repository has been created.<\/p>\n<p><a class=\"fancybox\" id=\"img-16\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-16.png\" alt=\"The repository has been created\" width=\"500\" height=\"280\" title=\"\"><\/a><\/p>\n<h2 id=\"step-testing-first-commit\">Step 6 &#8211; Testing First Commit<\/h2>\n<p>Back to your terminal shell, and set up the default git user and email.<\/p>\n<p>Run git commands below.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">git config --global user.name \"hakase\"<br\/>git config --global user.email \"<a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"2243464f4b4c624a43494351470c4b4d\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>\"<\/code><\/pre>\n<p>Now clone the repository.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">git clone https:\/\/git.hakase-labs.io\/hakase\/myrepo.git<\/code><\/pre>\n<p>Go to the repository directory &#8216;myyrepo&#8217; and edit the README.md file.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">cd myrepo\/<br\/>vim README.md<\/code><\/pre>\n<p>make changes on the README file, then save and exit.<\/p>\n<p>Now commit the repository.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">git add .<br\/>git commit -m 'Edit the README.md file by hakase-labs'<\/code><\/pre>\n<p>And push it to the server.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">git push origin master<\/code><\/pre>\n<p>Type your username and password.<\/p>\n<p>And following should be the result.<\/p>\n<p><a class=\"fancybox\" id=\"img-17\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/17.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-17.png\" alt=\"Test Git Commit\" width=\"500\" height=\"373\" title=\"\"><\/a><\/p>\n<p>Check to the repository page and make sure you get the changes as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-191\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_gitea_self_hosted_git_service_using_docker\/big\/191.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-gitea-self-hosted-git-service-using-docker-on-ubuntu-18-04-18.png\" alt=\"Gitea installed\" width=\"500\" height=\"286\" title=\"\"><\/a><\/p>\n<p>The Gitea installation with Docker on Ubuntu 18.04 has been completed successfully.<\/p>\n<h2 id=\"reference\">Reference<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Gitea is a fork of Gogs, the\u00a0easy to use self-hosted Git service. It is similar to GitHub, Bitbucket, and Gitlab. Gitea is lightweight code hosting solution written in Go, can run on minimal hardware requirements. It is a cross-platform application, can run anywhere Go can be compiled such as Windows, Linux, MacOS, ARM etc. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7377","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7377"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7377\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}