How to Install Gossa on Elementary OS Latest

Gossa is a self-hosted photo album written in Go. In this tutorial, we will go through the steps to install Gossa on Elementary OS Latest.

Prerequisites

Before we get started, make sure your system has the following prerequisites:

If any of the prerequisites are not met, you can install them by running the following commands:

sudo apt-get update
sudo apt-get install curl git

Step 1: Install Go

Gossa is written in Go, so we need to install Go to run it. To install Go, follow these steps:

  1. Download the Go tarball from the official website using curl.
curl -O https://dl.google.com/go/go1.16.7.linux-amd64.tar.gz
  1. Extract the tarball to the /usr/local directory.
sudo tar -xvf go1.16.7.linux-amd64.tar.gz -C /usr/local
  1. Set the environment variables by adding the following lines at the end of the /etc/profile file.
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
  1. Load the environment variables.
source /etc/profile
  1. Verify that Go is installed and the version by running the following command:
go version

Step 2: Install Gossa

Now that we have installed Go, we can install Gossa. To do that, follow these steps:

  1. Clone the Gossa repository from GitHub.
git clone https://github.com/pldubouilh/gossa.git
  1. Change into the gossa directory.
cd gossa
  1. Build the binary using the Go compiler.
go build
  1. Install Gossa by copying the binary to the /usr/local/bin directory.
sudo cp gossa /usr/local/bin/
  1. Verify that Gossa is installed by running the following command:
gossa -h

If Gossa is installed correctly, you should see the help message.

Step 3: Configure Gossa

Gossa needs a configuration file to run. We will create a basic configuration file to get started. Follow these steps:

  1. Create a new directory for Gossa's configuration files.
sudo mkdir /etc/gossa
  1. Create a new configuration file called gossa.conf.
sudo nano /etc/gossa/gossa.conf
  1. Paste the following contents into the file and save it.
# Gossa configuration file
[server]
# Listening address
addr = ":8080"

# Base URL (with trailing slash)
baseurl = "/"

# Absolute path to the directory containing the photos
photosdir = "/path/to/photos"

# Absolute path to the database directory
dbdir = "/path/to/database"

# Secret key for sessions
secret = "secret"

Replace /path/to/photos and /path/to/database with the absolute path to your photo directory and database directory, respectively.

  1. Create a new directory to store the Gossa database.
sudo mkdir /var/lib/gossa
  1. Set the appropriate permissions on the directories.
sudo chown -R $USER:$USER /etc/gossa /var/lib/gossa
sudo chmod -R 755 /etc/gossa /var/lib/gossa

Step 4: Run Gossa

Now that Gossa is installed and configured, we can run it. Follow these steps:

  1. Start Gossa in the terminal by running the following command:
gossa -conf /etc/gossa/gossa.conf
  1. Open a web browser and navigate to http://localhost:8080 to access the Gossa photo album.

Congratulations! You have successfully installed Gossa on Elementary OS Latest. You can now upload your photos and start browsing them using Gossa.

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!

Alternatively, for the best virtual desktop, try Shells!