How to Install and Configure Guacamole on Fedora Server Latest
Guacamole is a clientless remote desktop gateway that provides easy access to remote desktops and applications without installing any client software. In this tutorial, you will learn how to install and configure Guacamole on Fedora Server Latest.
Prerequisites
- A fresh installation of Fedora Server Latest
- Root access to the server
- Java 8 or higher version
Step 1 – Update System Packages
Before installing any new packages, it’s a good practice to update the system packages to their latest versions. To do this, run the following command:
sudo dnf update
Step 2 – Install Required Dependencies
Guacamole requires several dependencies to function. The following command installs all necessary packages for Guacamole:
sudo dnf install -y epel-release
sudo dnf install -y gcc make zlib-devel openssl-devel libpng-devel libjpeg-devel freetype-devel libssh2-devel libssh2-devel libssh libssh-devel libvncserver-devel tomcat-webapps createrepo
Step 3 – Install MySQL Server
Guacamole depends on MySQL to store its configuration and connection details. Therefore, to install MySQL server, run the following command:
sudo dnf install -y mariadb-server
After installing the MariaDB server package, start the MariaDB service and enable it to start automatically on system boot:
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Step 4 – Configure MariaDB Server
Securing the MariaDB server is essential for the safety of data stored in the database. The following command will secure your MySQL installation:
sudo mysql_secure_installation
Step 5 – Create Database and User for Guacamole
Create a new database, a user account, and grant necessary rights to the user.
mysql -u root -p
#Enter the password when prompted
CREATE DATABASE guacamole_db;
CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
FLUSH PRIVILEGES;
Make sure you replace "password" with a strong one.
Step 6 – Download and Install Guacamole Server
Download Guacamole from the official website https://guacamole.apache.org/download/ and extract it to the /opt/ directory using the following commands:
cd /opt
wget https://downloads.apache.org/guacamole/1.4.1/binary/guacamole-1.4.1.war
mv guacamole-1.4.1.war guacamole.war
mkdir -p /opt/guacamole_home
Step 7 – Deploy Guacamole Web Application
Copy Guacamole WAR (guacamole.war) file to the Tomcat webapps directory.
cp /opt/guacamole.war /usr/share/tomcat/webapps/
Step 8 – Deploy Guacamole Client
Expand the Guacamole WAR file by creating a new directory with the same name as the WAR file, without the ".war" extension.
mkdir /usr/share/tomcat/webapps/guacamole
unzip /usr/share/tomcat/webapps/guacamole.war -d /usr/share/tomcat/webapps/guacamole
Step 9 – Copy Configuration File
Copy the sample Guacamole configuration file and adjust the settings to the corresponding database and user account.
cp /usr/share/tomcat/webapps/guacamole/WEB-INF/classes/guacamole.properties /etc/guacamole/
echo "mysql-hostname: localhost" |sudo tee -a /etc/guacamole/guacamole.properties
echo "mysql-port: 3306" |sudo tee -a /etc/guacamole/guacamole.properties
echo "mysql-database: guacamole_db" |sudo tee -a /etc/guacamole/guacamole.properties
echo "mysql-username: guacamole_user" |sudo tee -a /etc/guacamole/guacamole.properties
echo "mysql-password: password" |sudo tee -a /etc/guacamole/guacamole.properties
Step 10 – Setting up Database schema
Initialize Guacamole's database schema
sudo cat /usr/share/tomcat/webapps/guacamole/docs/SQL/mysql/schema.sql | mysql -u root -p guacamole_db
Step 11 – Restart Services
Restart the Tomcat and MariaDB services to apply changes.
sudo systemctl restart tomcat.service
sudo systemctl restart mariadb.service
Step 12 – Configure Firewall
Modify the firewall rules to allow traffic to the Tomcat HTTP and HTTPS ports, which are 8080 and 8443, respectively.
sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
sudo firewall-cmd --zone=public --permanent --add-port=8443/tcp
sudo firewall-cmd --reload
Step 13 – Access Guacamole GUI
Now Guacamole is installed and ready to use. Open a web browser and visit http://YOUR_SERVER_IP:8080/guacamole/.
http://localhost:8080/guacamole/
You will see Guacamole login screen. Login with the default username and password, which are "guacadmin" and "guacadmin," respectively.
You can now configure Guacamole and add remote desktop connections.