How to Install Gossa on Linux Mint
Gossa is a self-hosted photo gallery written in Golang, which offers a great alternative to online photo-sharing platforms like Flickr, Picasa, or Google Photos. In this tutorial, we will show you how to install Gossa on Linux Mint, step by step.
Prerequisites
Before we start, make sure you have the following prerequisites in place:
- A running Linux Mint system (tested on Linux Mint 20.1).
- A sudo user account with administrative privileges.
- The latest version of
Goprogramming language installed on your system. - A web server with the
PHPandMySQLextensions enabled, likeApache2andMariaDB. - Basic knowledge of the Linux terminal.
Step 1: Download Gossa
First, start by opening your terminal and navigating to the directory where you want to download Gossa. In this example, we will use the /opt directory:
cd /opt
Next, use the following git command to download Gossa from the GitHub repository:
sudo git clone https://github.com/pldubouilh/gossa.git
Step 2: Install Dependencies
Once you have downloaded Gossa, use the following command to install its dependencies:
sudo apt-get install -y libjpeg-dev libexif-dev mariadb-server mariadb-client php php-mysql
This command will install the libjpeg-dev and libexif-dev packages, which are needed for image processing, and the MariaDB database server and PHP scripts to display and manage the photo gallery.
Step 3: Create a MySQL Database
Before you can start installing and configuring Gossa, you need to create a database and user for it. To do this, follow the steps below:
Start by logging in to the MySQL server:
sudo mysql -u rootYou will be prompted for the MySQL root password.
Once you are logged in, create a new database for Gossa:
CREATE DATABASE gossa;Next, create a new user account for Gossa with full access to the database you just created. Replace
gossauserandpassword123with your own choices:CREATE USER 'gossauser'@'localhost' IDENTIFIED BY 'password123'; GRANT ALL PRIVILEGES ON gossa.* TO 'gossauser'@'localhost';This creates a new user account named
gossauserwith the passwordpassword123and grants it full access to thegossadatabase.Finally, exit the MySQL shell:
EXIT;
Step 4: Configure Gossa
Next, you need to configure Gossa to connect to your MySQL database:
Start by copying the
config.toml.samplefile toconfig.toml:cd /opt/gossa sudo cp config.toml.sample config.tomlEdit the
config.tomlfile using your favorite text editor, such asnanoorvim:sudo nano config.tomlFind the following lines in the file:
[database] host = "127.0.0.1" username = "" password = "" name = ""Modify the lines to look like this:
[database] host = "127.0.0.1" username = "gossauser" password = "password123" name = "gossa"This sets the database credentials for Gossa to connect to the database we just created.
Save the changes and exit the text editor.
Step 5: Build and Run Gossa
After configuring Gossa, it's time to build and run the application:
Start by building the Gossa binary:
sudo go build -o gossaOnce the build completes, start the Gossa server:
sudo ./gossaYou should see the following output in your terminal:
INFO[0000] Listening on :8080 INFO[0000] Running in Development modeThis means that Gossa is running on port 8080 and is ready to use.
Open a web browser and navigate to the following URL:
http://localhost:8080/You should see the Gossa welcome page.
Conclusion
You have successfully installed Gossa on your Linux Mint system. You can now start uploading your photos and organizing them into albums using the Gossa web interface. Enjoy!