Tutorial: Installing GoCD on NixOS Latest

GoCD is an open-source continuous delivery server that helps automate and streamline the build, test, and deployment processes. In this tutorial, we will cover how to install GoCD on NixOS Latest, a Linux distribution that uses the Nix package manager.


Before starting the installation, make sure that you have the following:

Step 1: Add the GoCD Repository to NixOS

To add the GoCD repository to NixOS, we need to create a new file named gocd.nix in the /etc/nixos directory. Use the following command to create the file:

sudo nano /etc/nixos/gocd.nix

Now, paste the following code into the file:

{ config, lib, pkgs, ... }:

    platform = lib.system.platform;
    gocdVersion = "21.2.0-12488";
    gocdUrl = "https://download.gocd.org/binaries/${gocdVersion}/generic/go-agent-${gocdVersion}.${platform}.tar.gz";
    services.go-agents = {
      enable = true;
      package = pkgs.runCommand "go-agent" {} ''
        ${pkgs.fetchurl { url = "${gocdUrl}"; sha256 = "1qk5wcl1kiyw1vc79bcj98vzraqqwfvj7sj9d223vmzjh727lbv9"; }}

        mkdir -p $out

        cp -r ./* $out

Then save and close the file by pressing CTRL+X and Y.

Step 2: Update NixOS Configuration

Now, we need to update the NixOS configuration to include the GoCD package. Run the following command to open the NixOS configuration file:

sudo nano /etc/nixos/configuration.nix

Find the imports section and add the following line to include the GoCD configuration:

imports = [

Save and close the file by pressing CTRL+X and Y.

Step 3: Activate Configuration and Restart the System

Now that the NixOS configuration has been updated, we need to activate it and restart the system. Run the following command to activate the configuration:

sudo nixos-rebuild switch

This command will take care of building and installing the necessary packages for GoCD. Once the process is completed, restart the system using the following command:

sudo reboot

Step 4: Access GoCD Web Interface

After the system reboots, you can access the GoCD web interface using your favorite web browser. Point your browser to http://localhost:8153/go or use the IP address of the server instead of localhost.

You should now be able to see the GoCD web interface and start setting up your pipelines.


In this tutorial, we have covered how to install GoCD on NixOS Latest by adding the GoCD repository, updating the NixOS configuration, and activating the changes. With GoCD installed, you can now start automating and streamlining your software delivery processes.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!