Self-host Gogs
v0.14.3Lightweight Git hosting with issues, PRs and wikis
- Stars
- 47 929
- CPU
- 2 CPU cores
- RAM
- 512MB
- Ports
- 3000 (HTTP server for the web UI, REST API and Git over HTTP), 2222 (Builtin SSH server for Git over SSH (enabled with START_SSH_SERVER))
- Requires
- Git
gogs/gogsWhat is Gogs?
Gogs is a Git forge written in Go that lets you run your own repository hosting, code review and collaboration stack on hardware you control. It is distributed as a standalone binary for Linux, macOS, Windows and ARM boards, and also as container images, while repository metadata can live in PostgreSQL, MySQL, MariaDB or SQLite and clones are served over SSH, HTTP and HTTPS. Each repository gets issues, pull requests, a wiki, protected branches, deploy keys, Git hooks, Git LFS and outbound webhooks in Slack, Discord or DingTalk shapes; whole hosts can be migrated or mirrored from other code hosting services. People can sign in with a local account, LDAP, SMTP, PAM, a trusted reverse-proxy header, or a GitHub.com and GitHub Enterprise account. A web editor handles quick file and wiki changes, notebooks and PDFs render inline, and the interface is translated into more than 31 languages. Operationally you write your own app.ini under a custom/ directory, run the server as a systemd unit or container, and use the same binary's gogs command for maintenance such as creating users, running git gc, backing up and restoring. The REST API is described as experimental, and the older privileged Docker image is being superseded by a non-root one. Setup guides, an API reference and a live demo instance are on the project site.
Gogs alternatives
GokapiAn open-source, self-hosted Firefox Send alternative: expiring download links, end-to-end encryption, user roles, file requests and optional S3-compatible storage.CompareGokapi with Gogs
ForgejoA self-hosted, open-source software forge: git hosting with issues, pull requests, wikis, CI and package registries in one lightweight binary or container.CompareForgejo with Gogs
MirrorProxyMirrorProxy is a self-hosted, open-source mirror acceleration gateway for GitHub, Docker/OCI, language packages, and Linux/BSD repos with access control and quotas.CompareMirrorProxy with Gogs
gitbucketA self-hosted, open-source Git platform in Scala: run one war file on Java 17 for repos, issues, pull requests, wiki, LDAP/OIDC logins and GitHub-compatible APIs.Comparegitbucket with Gogs
dockgeA self-hosted, open-source web UI for Docker Compose stacks: create, edit and deploy compose.yaml files, with a live web terminal and multi-host agents.Comparedockge with Gogs
git-confedSelf-hosted web tool that scans folders for Git repos and applies shared config blocks (user, remotes) to multiple repos via a Bootstrap UI.Comparegit-confed with Gogs
deepwiki-openOpen-source, self-hosted generator that turns GitHub, GitLab or Bitbucket repositories into AI-written wiki docs with diagrams and RAG chat.Comparedeepwiki-open with Gogs
ArgusSelf-hosted open-source tool that monitors software releases from GitHub, websites, and Docker registries, then sends notifications and webhooks on new versions.CompareArgus with Gogs
Should you self-host Gogs?
Gogs scores 79/100 on selfhost.directory (how scoring works) and ranks #3 of 15 in Code Hosting. It has 47 929 GitHub stars, +68 in the last 30 days.
It shipped 6 stable releases in the past year. The latest, latest-commit-build, came out on 17 June 2026.
Setup is easy: most people get it running in one sitting. An official Docker image is available. It is MIT-licensed and written mostly in Go.
Its closest alternative on selfhost.directory is Gitea (89/100, 59 010 stars). It scores higher overall, so compare the two before you pick. See Gogs vs Gitea side by side.
Features
- Backup and Restore
- Issue Tracking
- Localization
- Notebook and PDF rendering
- Protected branches
- Pull Requests
- Repository migration and mirroring
- REST APIProject describes API support as experimental.
- User and organization management
- Web-based file editor
- Webhooks
- Wiki
FAQ
Why can't I create a wiki for my mirrored repository?
Mirrors are read-only copies, so they cannot own a wiki. Either edit the wiki upstream, or convert the mirror into a regular repository under Settings > Danger Zone.
How do I give Git hooks permission to users?
Toggle the Git hooks permission for a user in Admin Panel > Users; because it allows arbitrary code execution on the server it should only be given to fully trusted users.
How do I reset a forgotten administrator password?
Stop Gogs, create a temporary admin account on the command line with gogs admin create-user, restart, then set a new password for the original admin through Admin Panel > Users and delete the temporary account.
How can I become an administrator?
The first registered account (ID 1) is made an administrator without needing email confirmation; afterwards admins promote others from Admin Panel > Users.
How do I make a custom robots.txt?
Put a robots.txt file in the custom/ directory at the installation root and Gogs serves it at /robots.txt.
How do I run Gogs in offline mode or on an intranet?
Set OFFLINE_MODE = true in the [server] section of app.ini, which turns off outside network calls such as CDN resources and Gravatar avatars.
What do I do if another service is already using port 3000?
Start the first run with a different port using the -port flag (for example gogs web -port 3001), then set the matching HTTP_PORT in your custom/conf/app.ini so restarts keep it.
More in Code Hosting
harnessSelf-hosted, open-source DevOps platform: Git hosting with pull requests, CI/CD pipelines, Gitspaces dev environments, and Docker and Helm artifact registries.
legitOpen-source, self-hosted browsing UI for Git repos, built in Go: serves bare repositories from a folder with custom templates, README rendering and HTTP cloning.
OneDevOneDev is a powerful and simple DevOps platform that integrates Git server, Kanban, CI/CD, and package registries into a seamless experience.- PagurePagure is a lightweight, git-centered forge for hosting projects with documentation, ticketing, and pull-request mechanisms.
rgitSelf-hosted, open-source Git web interface in Rust using RocksDB caching and gitoxide for fast browsing with dark mode.- RhodeCodeRhodeCode is an open-source, self-hosted platform for unified repository management, supporting Git, Mercurial, and Subversion. It provides enterprise-grade security, code review, workflow automation, and permission management for teams.
Roundup Issue TrackerRoundup is a highly customizable issue-tracking system with command-line, web, REST, XML-RPC, and e-mail interfaces. It is designed to be easy to install and use, and can be adapted to various use cases.
scm-managerSelf-hosted open-source repository manager for Git, Mercurial and Subversion with web UI, REST API, and plugin system.
self-forgeself-forge mirrors public GitHub repos and serves them via a minimal, server-rendered web UI with no JavaScript or CSS.
BuzzOpen-source, self-hosted Nostr relay workspace where people and AI agents share channels, threads, canvases, voice huddles, YAML workflows and git hosting.- CgitA hyperfast web frontend for Git repositories written in C.
Drone CIOpen-source, self-hosted DevOps platform: Git hosting, CI/CD pipelines, cloud dev environments and artifact registries. Drone's successor, runs in one Docker container.
0 comments