Skip to content

Setup GotHub manually

Note

We recommend you to use Docker over manually running GotHub, because it's easier and you can have automatic updates via Watchtower. You can find the Docker documentation here. If you still want to run GotHub manually, you can continue reading.

Requirements

  • Git
  • Go 1.19 or higher
  • A web server (we recommend Caddy)

Installation

You need to clone the repository. You can do this by running the following command:

git clone https://codeberg.org/gothub/gothub.git
git checkout master

If you want to run the bleeding edge, in exchange for having to deal with occasional bugs, run the following command:

git checkout dev

Then, you need to build the binary. You can do this by running the following command:

go build -ldflags="-X codeberg.org/gothub/gothubs/utils.Branch=$(git rev-parse --abbrev-ref HEAD)"

Configuration

GotHub uses environment variables for configuration. You can find a list of all environment variables here.

GotHub has a setup wizard that will help you configure GotHub. Run the following command to start the setup wizard:

./gothub setup

The wizard will ask you a few questions about your privacy practices, where you're hosting etc. After you've answered all the questions, the wizard will generate a ".env" file for you. You can then start GotHub by running the following command:

./gothub serve

You can also pass --port to specify a port to run GotHub on. This overrides the GOTHUB_PORT environment variable.

Keep GotHub up-to-date

GotHub's CLI has a command to update GotHub. You can run this command by running the following command:

./gothub update

It will try to pull from Git and then rebuild the binary. If it doesn't work, just run git pull and then go build.