Build From Source

Run Pritunl Cloud from repository

Pritunl Cloud can be built from source to customize the software for different use cases. The Pritunl Cloud package should first be installed which will included the required files for the web server. Run the commands below to install the latest version of Golang.

sudo rm -rf /usr/local/go
echo "bd78114b0d441b029c8fe0341f4910370925a4d270a6a590668840675b0c653e go1.17.5.linux-amd64.tar.gz" | sha256sum -c -

sudo tar -C /usr/local -xf go1.17.5.linux-amd64.tar.gz
rm -f go1.17.5.linux-amd64.tar.gz

Run the commands below to configure the Golang environmental variables. Pritunl Cloud is built without Go modules and requires GO111MODULE=off to be set.

tee -a ~/.bashrc << EOF
export GO111MODULE=off
export GOPATH=\$HOME/go
export PATH=/usr/local/go/bin:\$PATH:\$HOME/go/bin
source ~/.bashrc

Use Go to download the Pritunl Cloud source then enter the source directory. Edit the file to make modifications such as changing Qemu parameters in the ./qemu/qemu.go file then compile the source. First stop the existing Pritunl Cloud binary and run the new binary in the source directory. Press Ctrl+C to exit while running in the foreground. Pritunl Cloud uses a state design and can be stop and started without effecting running virtual machines, any changes to the state while not running will be updated when the application is run again.

go get
cd ~/go/src/

nano ./qemu/qemu.go
go build -v

sudo systemctl stop pritunl-cloud
sudo ./pritunl-cloud start