Quick Links
Don’t want to push your code to a hosted Git repository?
Then run your own Git server in-house.
Gogs is the easiest way to do that.
Here’s how to set it up.
The Problem With Cloud-Hosted Repositories
Without a doubt,Gitis the preeminent version control system.
Even with single-developer projects, Git provides value and benefit because of its versioning functionality.
For multi-developer projects, Git brings another dimension entirely.
Related:What Is GitHub, and What Is It Used For?
That’s why services likeGitHub,GitLab, andBitBucketexist, and why they’ve seen such uptake and growth.
GitHub alone hosts over 200 million repositories.
But cloud-hosted repositories don’t suit everyone.
Most of them charge to host private repositories.
Some of them impose storage limits, user limits, or data transfer limits on free accounts.
That’s where Gogs comes in.
What Is Gogs?
Gogsis a relatively new project, written inGo, that delivers an easy-to-install, yet fully-featured Git instance.
There are no limits to team size, storage, or anything else.
You fill out a few forms, and Gogs initializes your repository and adds you as the admin user.
it’s possible for you to then browse to your Gogs instance and add users and create repositories.
Gogs uses a database for its back-end storage.
It supportsMySQL,MariaDB,PostgreSQL, andTiDB.
For smaller teams, it’s possible for you to useSQLite3.
If you opt for SQLite3, it’s installed for you.
Of course, you’ll need tohave
installed, too.
We downloaded the “Linux amd64” ZIP file, for installation onto a 64-bit computer with Ubuntu 22.10.
The file is small—only about 25MB—so don’t be surprised if it downloads very quickly.
Locate the file in your file system.
Some file browsers might use “Extract Here” instead.
A directory is extracted from the ZIP file.
It’s named after the downloaded file.
In our case, it was called “gogs_0.11.91_linux_amd64.”
Double-poke the extracted directory and you’ll see another directory called “gogs.”
Double-poke the “gogs” directory.
You’ll see the Gogs files and directories.
Right-click in the file net internet ride window and select “Open in Terminal” from the context menu.
Add “:3000” after the IP address or internet name.
Don’t include any whitespace.
The first time you do this, you’ll see the form that captures some initial setup information.
If you want to set up email notifications you’ll need to configure a few extra steps.
This will require options on the mail server to allow your account to accept and relay the email.
These parameters vary from mail server to mail server.
Gogs requires you to enter the following information about your email server.
smack the blue “Install Gogs” button when you’re ready to proceed.
Gogs writes a configuration file, initializes the database storage, and starts up your Git instance.
You’ll see the main Gogs home page.
The first user account you create will automatically be given administrator rights.
nudge the “Register” link.
smack the green “Create New Account” button.
You’ll see the “Sign In” page.
slide in your account name and password, and choose the green “Sign In” button.
The Gogs “Dashboard” view is a little sparse until you have a repository to work with.
tap the blue “+” button, and complete the “New Repository” form.
It asks for a repository name, whether it is private or public, and a description.
The next three fields createfilesfrom templates.
Your new repository is displayed for you.
All of this was done using standard Git commands.
As expected, our new file shows up in our Gogs repository.
“README.md” files are usually written in Markdown.
By clicking on the “Edit” pencil icon, we can directly edit our “README.md” file.
We added some more text, used Markdown tags to insert hyperlinks and italics, and committed our changes.
All from within Gogs.
The Easiest Git Server - Bar None
Gogs is an absolute triumph.
It perfectly blends functionality with simplicity.
Out of the box, it will meet the needs of the majority of hobbyist or small development teams.
Note that the path will reflect the version of Gogs you’re using.
General system administration can be performed from the admin panel, found at
.
If you’re wary aboutcloud-hostedrepositories that are ultimately under the control of others, consider using Gogs locally.
You won’t lose functionality, but you will gain control and guaranteed privacy.
Related:How to Check and refresh your Git Version