Skip to content

Example of preparing the environment for Ubuntu Server#

Updating the system#

Update the system:

sudo apt update
sudo apt upgrade -y


Set up the firewall:

Allow the SSH connection:

sudo ufw allow ssh

Base rules:

sudo ufw default deny incoming
sudo ufw default allow outgoing

Allow HTTP and HTTPS connections:

sudo ufw allow http
sudo ufw allow https

Enable the firewall:

sudo ufw enable


Do not forget to create a module:

go mod init example


go get


Download and run our web server as an example:

Download Example:


Running the application:

go run main.go