How to Install Guacamole on Debian Latest

Guacamole is a free, open-source remote desktop gateway that allows you to access your desktop over the internet from anywhere. It allows you to access your desktop via a web browser, eliminating the need for any additional software on your local machine. In this tutorial, we will go through the steps to install Guacamole on Debian.

Prerequisites

Before you begin, make sure you have:

Step 1: Install Required Dependencies

First, make sure your system is up-to-date by running the following command:

sudo apt update
sudo apt upgrade

Next, install the necessary packages for Guacamole installation:

sudo apt install -y libcairo2-dev libjpeg62-turbo-dev libpng-dev libossp-uuid-dev libavcodec-dev libavutil-dev libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev tomcat9 tomcat9-admin tomcat9-common tomcat9-user mysql-server mysql-client libmysql-java

Note: All the above libraries should be installed.

Step 2: Download and Install Guacamole

Now, go to the official website of Guacamole and download the latest version of Guacamole.

curl -O https://downloads.apache.org/guacamole/1.3.0/source/guacamole-server-1.3.0.tar.gz
tar -xzf guacamole-server-1.3.0.tar.gz
cd guacamole-server-1.3.0

Next, configure, make and install the package.

sudo ./configure --with-init-dir=/etc/init.d
sudo make
sudo make install
sudo ldconfig
sudo systemctl daemon-reload
sudo systemctl start guacd
sudo systemctl enable guacd

Step 3: Install Guacamole Client

Install the Guacamole client by running the following command:

sudo apt install guacamole

Step 4: Configure Guacamole Client

Next, configure the Guacamole client by creating a symbolic link to the Guacamole web root directory.

sudo ln -s /usr/share/guacamole/ /var/lib/tomcat9/webapps/guacamole

Now, you need to configure the Guacamole database. First, log in to the MySQL console.

mysql -u root -p

Then, create a new database for Guacamole.

mysql> CREATE DATABASE guacamole_db;

Now, create a new user and grant it privileges to the Guacamole database.

mysql> CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
mysql> FLUSH PRIVILEGES;

After that, import the Guacamole database schema.

sudo cat guacamole-auth-jdbc-1.3.0/mysql/schema/*.sql | mysql -u root -p guacamole_db

Configure Guacamole to Use the MySQL Database

Next, you need to configure Guacamole to use the MySQL database. Modify the Guacamole configuration file with the following information.

export GUACAMOLE_HOME=/etc/guacamole
sudo mkdir /etc/guacamole
sudo cat > /etc/guacamole/guacamole.properties << "EOF"
guacd-hostname: localhost
guacd-port: 4822
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: guacamole_user
mysql-password: password
user-mapping: file://etc/guacamole/user-mapping.xml
EOF

Configure Guacamole User Mapping

Next, you need to configure the Guacamole user mapping. Create a new file called user-mapping.xml.

sudo cat > /etc/guacamole/user-mapping.xml << "EOF"
<user-mapping>
    <authorize username="user" password="password">
        <connection name="My Desktop">
            <protocol>vnc</protocol>
            <param name="hostname">127.0.0.1</param>
            <param name="port">5901</param>
            <param name="password">password</param>
        </connection>
    </authorize>
</user-mapping>
EOF

Restart Tomcat

Now, restart the Tomcat service.

sudo systemctl restart tomcat9
sudo systemctl enable tomcat9

Step 5: Configure Firewall

Next, you need to allow access to the Guacamole web application.

sudo ufw allow 8080/tcp
sudo ufw reload

Step 6: Access Guacamole Web Interface

Finally, access the Guacamole web interface by navigating to http://<IP_address>:8080/guacamole on your web browser. Log in with your username and password.

Conclusion

Congratulations! You have successfully installed and configured Guacamole on Debian latest. You can now access your remote desktop from anywhere through a web browser.

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!