Loading...

How to Install Gogs on Ubuntu 18.04

Simple.Predictable.Scalable

Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing Gogs on Ubuntu 18.04

Gogs is a self-hosted Git service written in Go. It is lightweight and can be deployed on your own server, allowing you to have full control over your repositories and user management. Gogs supports all major operating systems and provides a web interface that includes essential features like repository management, collaborative pull requests, user/team management, and more.

Installation Steps:

Follow the steps below to install Gogs on Ubuntu 18.04:

sudo apt update
sudo apt upgrade
sudo apt install git mysql-server apt-transport-https
sudo mysql
CREATE DATABASE gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'gogs'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost';
FLUSH PRIVILEGES;
EXIT;
wget https://dl.gogs.io/0.12.3/gogs_0.12.3_linux_amd64.tar.gz
tar -xvf gogs_0.12.3_linux_amd64.tar.gz
cd gogs
cp custom/conf/app.ini{.sample,}
nano custom/conf/app.ini

Within the file, modify the following configuration:

DOMAIN = localhost (or your domain)
HTTP_PORT = 3000
ROOT_URL = http://localhost:3000/
sudo nano /etc/systemd/system/gogs.service

Paste the following content into the file:

[Unit]
Description=Gogs
After=syslog.target
After=network.target

[Service]
ExecStart=/path/to/gogs/gogs web
Restart=always
Environment=USER=gogs

[Install]
WantedBy=multi-user.target

Replace "/path/to/gogs" with the actual path to your Gogs installation directory.

sudo systemctl start gogs
sudo systemctl enable gogs
http://localhost:3000/

Follow the on-screen instructions to complete the Gogs setup process, including setting up an administrator account and connecting to the MySQL database.

  1. Update the system:
  2. Install Git, MySQL server, and other dependencies:
  3. Create a MySQL database and user:
  4. Download the Gogs binary:
  5. Extract the downloaded archive:
  6. Modify the app.ini file:
  7. Create a Gogs service:
  8. Start and enable the Gogs service:
  9. Open your browser and access your Gogs instance:
  10. After setup, you can access the Gogs interface and start creating repositories and managing users.

You have successfully installed Gogs on Ubuntu 18.04. Enjoy hosting your own Git service!

Refer A Friend
Get $25

Installing Gogs
Gogs installation
Gogs on Ubuntu 18.04
Ubuntu 18.04 Gogs installation
Gogs setup guide
How to install Gogs on Ubuntu 18.04
Gogs installation steps
Step-by-step Gogs installation on Ubuntu 18.04
Install Gogs on Ubuntu 18.04
Gogs installation tutorial

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.