Skip to main content

Install Apache Guacamole on Ubuntu 22.04

 

Install Apache Guacamole on Ubuntu 22.04

Apache Guacamole Installation Guide

Remote Desktop Gateway for Ubuntu 22.04

Ubuntu 22.04 Remote Desktop

What is Apache Guacamole?

Apache Guacamole is a clientless remote desktop gateway that supports standard protocols like VNC, RDP, and SSH. Thanks to HTML5, once Guacamole is installed on a server, all you need to access your desktops is a web browser.

Clientless

No plugins or client software needed

Secure

Supports SSL/TLS encryption

Multi-protocol

RDP, VNC, SSH all in one place

Prerequisites

  • Ubuntu 22.04 server with root or sudo privileges
  • At least 2GB RAM (4GB recommended for production)
  • Minimum 10GB disk space
  • Domain name pointing to your server (recommended)

Installation Steps

1

Update System Packages

Before installing any new software, it's good practice to update your system packages.

sudo apt update && sudo apt upgrade -y
2

Install Dependencies

Guacamole requires several dependencies including Java, Tomcat, and others.

sudo apt install -y make gcc g++ libcairo2-dev libjpeg-turbo8-dev libpng-dev \
libtool-bin libossp-uuid-dev libavcodec-dev libavformat-dev libavutil-dev \
libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev \
libvncserver-dev libwebsockets-dev libpulse-dev libssl-dev libvorbis-dev \
libwebp-dev tomcat9 tomcat9-admin tomcat9-user

Note: This installs a large number of packages required for Guacamole's various features.

3

Install Guacamole Server

Download and compile the Guacamole server from source.

wget https://downloads.apache.org/guacamole/1.5.0/source/guacamole-server-1.5.0.tar.gz
tar -xzf guacamole-server-1.5.0.tar.gz
cd guacamole-server-1.5.0
./configure --with-init-dir=/etc/init.d
make
sudo make install
sudo ldconfig

Warning: The compilation process may take several minutes depending on your server's resources.

4

Install Guacamole Client

Download and install the Guacamole web application.

sudo mkdir -p /etc/guacamole/{extensions,lib}
wget https://downloads.apache.org/guacamole/1.5.0/binary/guacamole-1.5.0.war
sudo mv guacamole-1.5.0.war /var/lib/tomcat9/webapps/guacamole.war
sudo systemctl restart tomcat9
5

Configure Guacamole

Create configuration files for Guacamole.

sudo nano /etc/guacamole/guacamole.properties

Add the following content:

# Hostname and port of guacamole proxy
guacd-hostname: localhost
guacd-port: 4822

# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: guacamole_user
mysql-password: your_password_here
sudo nano /etc/tomcat9/Catalina/localhost/guacamole.xml

Add the following content:

<Context path="/guacamole" docBase="/var/lib/tomcat9/webapps/guacamole.war">
  <Parameter name="guacamole-home" value="/etc/guacamole"/>
</Context>
6

Install and Configure MySQL

Guacamole requires a database for authentication and storing connections.

sudo apt install -y mysql-server

Secure MySQL installation:

sudo mysql_secure_installation

Create database and user:

sudo mysql -u root -p
CREATE DATABASE guacamole_db;
CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
FLUSH PRIVILEGES;
exit

Import the schema:

wget https://downloads.apache.org/guacamole/1.5.0/binary/guacamole-auth-jdbc-1.5.0.tar.gz
tar -xzf guacamole-auth-jdbc-1.5.0.tar.gz
sudo cp guacamole-auth-jdbc-1.5.0/mysql/guacamole-auth-jdbc-mysql-1.5.0.jar /etc/guacamole/extensions/
cat guacamole-auth-jdbc-1.5.0/mysql/schema/*.sql | sudo mysql -u root -p guacamole_db
7

Start Services

Start and enable the Guacamole and related services.

sudo systemctl start guacd
sudo systemctl enable guacd
sudo systemctl restart tomcat9
sudo systemctl restart mysql
8

Access Guacamole Web Interface

Guacamole should now be accessible via your web browser.

Default Login:

Username: guacadmin

Password: guacadmin

Change this password immediately after first login!

http://your_server_ip:8080/guacamole

Post-Installation Security

Change Default Credentials

Immediately change the default guacadmin password after first login.

Setup SSL/TLS

Configure Nginx or Apache as a reverse proxy with Let's Encrypt SSL certificate.

Create Additional Users

Create individual user accounts instead of sharing the admin account.

Troubleshooting

Guacamole not loading

Check Tomcat logs: sudo tail -f /var/log/tomcat9/catalina.out

Connection issues

Verify guacd is running: sudo systemctl status guacd

Database errors

Check MySQL logs: sudo tail -f /var/log/mysql/error.log

Comments

Popular posts from this blog

How to Check Hardware Details on Linux:

  Whether you're troubleshooting hardware issues, planning an upgrade, or just curious about your system’s specifications, Linux provides a variety of commands to gather comprehensive hardware information. Here are some essential commands: 1.  Use lscpu to get detailed information about the CPU, including architecture, cores, threads, and CPU speeds. # lscpu                                                 2. The lshw command provides a complete overview of hardware configuration, including CPU, memory, storage, and network. You’ll likely need superuser privileges to run it. # sudo lshw                                                                               ...

testing

09052025 T-1 { "volume_groups" : { "vgroot" : { "vgsize" : "304G" , "fs_type" : "xfs" } } , "logical_volumes" : { "root" : { "lvroot" : { "vgname" : "vgroot" , "lvname" : "lvroot" , "lvsize" : "12G" , "mountpoint" : "/" , "purpose" : "root filesystem" , "disk" : 1 , "partition" : 2 } } , "swap" : { "lvswap" : { "vgname" : "vgroot" , "lvname" : "lvswap" , "lvsize" : "4G" , "mountpoint" : "NA" , "purpose" : "swap" , "disk" : 1 , "partit...

How Virtual Machines are Created in OpenStack: A Complete Backend Workflow:

When creating a Virtual Machine (VM) in OpenStack, several components work together in the backend to provision the instance. Here's a step-by-step explanation of how the process flows: 1. User Request Interface Used : The user initiates the VM creation through the Horizon Dashboard (web UI), the OpenStack CLI ( openstack server create ), or the OpenStack API. Request Information : The request includes parameters such as: VM name. Image (the operating system or custom image to boot from). Flavor (the compute, memory, and storage specifications). Network (which network the VM will be connected to). Security Groups (firewall rules). Key Pair (for SSH access). 2. API (Nova API) Component : Nova (Compute service). Process : The request is received by the Nova API , which validates the request (checks if the requested resources like the image, flavor, and network exist). If valid, the API creates an entry in the database for the new instance. Nova's Role : Nova is the core service r...