Back to articles
Security & Anti-DDoS

Deploy Apache Guacamole via Cloudflare Tunnels: Secure Remote Access Solution Without VPN

Guide to deploying Apache Guacamole on a Cloud VPS using Cloudflare Tunnels for secure remote access without a traditional VPN. Leverage Cloudflare's Zero Trust to protect...

DPTCloud Engineering4 min read
Deploy Apache Guacamole via Cloudflare Tunnels: Secure Remote Access Solution Without VPN

Introduction

Apache Guacamole is an open-source remote access solution that allows users to connect to servers via protocols such as RDP, VNC, and SSH without installing client software. When deployed on a Cloud VPS, remote access must be rigorously secured to prevent network threats. Cloudflare Tunnels provide a secure method to expose internal services without opening ports on firewalls or relying on traditional VPNs.

Requirements and Preparation

Deploy Apache Guacamole on VPS

Follow these steps to install and configure Apache Guacamole:

Step 1: Update System and Install Required Components

sudo apt update
sudo apt upgrade -y
sudo apt install -y guacamole-server guacamole-client tomcat9 tomcat9-admin

Step 2: Configure Guacamole

Create the configuration directory and the `guacamole.properties` file:

sudo mkdir -p /etc/guacamole
sudo touch /etc/guacamole/guacamole.properties

Edit the `guacamole.properties` file:

sudo nano /etc/guacamole/guacamole.properties

Add the following content (adjust values as needed):

guacamole-server:
  guacd-hostname: localhost
  guacd-port: 4822
  mysql-hostname: localhost
  mysql-port: 3306
  mysql-database: guacamole_db
  mysql-username: guacamole_user
  mysql-password: your_password

Step 3: Configure Tomcat to Run Guacamole

Create the `guacamole.war` file and copy it to Tomcat's webapps directory:

sudo cp /var/lib/tomcat9/webapps/guacamole.war /var/lib/tomcat9/webapps/

Set Up Cloudflare Tunnels

Cloudflare Tunnels enable secure exposure of internal services without opening firewall ports. This is a safer alternative to traditional VPNs.

Step 1: Install Cloudflare Tunnel

sudo apt install -y cloudflared

Step 2: Log in to Cloudflare

Run the following command to authenticate:

cloudflared tunnel login

Create a new tunnel:

cloudflared tunnel create guacamole-tunnel

Step 3: Configure the Tunnel

Create the configuration file `config.yml`:

sudo nano /etc/cloudflared/config.yml

Add the following content:

tunnel: guacamole-tunnel
credentials-file: /etc/cloudflared/guacamole-tunnel.json

ingress:
  - hostname: guacamole.example.com
    service: http://localhost:8080
  - service: http_status:404

Step 4: Run the Tunnel

sudo cloudflared tunnel run guacamole-tunnel

Security and Authentication

Enhance security using the following measures:

Verify Connectivity

After configuration, access the following URL:

https://guacamole.example.com

Ensure you can access the Guacamole interface. If not, check the logs for Cloudflare Tunnels and Guacamole.

Troubleshooting

  • Unable to access Guacamole: Check if the tunnel is running using cloudflared tunnel list. Verify the configuration in config.yml.
  • SSL/TLS certificate issues: Ensure ACME SSL/TLS is correctly configured with Cloudflare. Refer to automated SSL/TLS certificate renewal guide.
  • Cannot connect to MySQL: Verify that the MySQL service is running and that the username and password are correct.

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478