How to setup pangolin with RustDesk and GCP as VM #1256
Nick390
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
|
Thanks for the awesome post! |
Beta Was this translation helpful? Give feedback.
2 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment





Uh oh!
There was an error while loading. Please reload this page.
-
I would like to clarify that this is a question and answer I searched for a long time, but after a long time and a lot of tinkering, I figured out how to do it. And I am here to help you do the same.
First, you must know that the environment I have is very, very complicated, but I will try in every way to make it easier for you.
Let's start with the pangolin service on GCP (Google Cloud Platform). What you need:
Step 1: Sign up and enable billing on Google Cloud
Step 2: Create a new Google Cloud project and link it to your billing account
To link the project to a billing account:
Step 3: Create and download a Service Account key (JSON)
Step 4: Prepare your Terraform working directory and place the Service Account key
pangolin-vm-terraform.File > Open Folder > select your folder).service-account.jsonfor simplicity.main.tf.main.tf, based on your VM specs:I wrote it as Terraform because it is the easiest way to publish quickly
Step 5: Install Terraform and run it to deploy your VM and firewall rules
Go to the [Terraform Downloads page].
Download the appropriate version for your operating system (Windows, macOS, Linux).
Unzip the downloaded file.
Add the Terraform executable folder to your system’s PATH environment variable so you can run
terraformfrom any terminal.To verify the installation, open your terminal and run:
You should see the installed Terraform version printed.
main.tfandservice-account.json.yesto confirm and start deployment.Step 6: Configure DNS to access the pangolin page
Before installing Pangolin, you need to add an A record in your DNS provider to point a domain or subdomain to your server's external IP address.
Example DNS record:
Once this record is set and propagated, you will be able to access Pangolin via the configured domain.
Step 7: Install Pangolin on your VM
1. Install the Google Cloud SDK (
gcloud)If you don’t have
gcloudinstalled locally, follow these steps:Download and install from [Google Cloud SDK installer]
After installation, run:
to configure your account.
2. Connect to your VM via SSH using
gcloudUse the following command to SSH into your VM (replace project, zone, and instance name if different):
3. Follow the official Pangolin installation guide
After connecting to your VM, follow the installation steps from the official documentation:
[Pangolin Quick Install Guide]
Step 8: Setting up RustDesk Server
Here is the Docker Compose configuration file for RustDesk server. You need to use this
docker-compose.ymlfile and run it with Docker Compose.How to run with Docker Compose:
Make sure Docker and Docker Compose are installed on your server.
Save this file as
docker-compose.ymlinside the/path/rustdesk/directory.Run the containers in detached mode by executing:
To follow logs, use:
Step 9: Create Sites and Resources in Pangolin UI
1. Access the User Interface and Create a Site
2. Create a Resource
rustdesk-21115.Raw TCP/UDP Resource.TCP2111521115.3. Create the required resource TCP Ports (5 entries)
4. Create the required resource UDP Ports (3 entries)
All these resources point to the same IP or container name; in your case, I point them to the same server IP.
Step 10: Port Setup from GCP to your Local Server via Traefik
Adding ports through Pangolin is not enough; you must manually add the ports to ensure they are properly routed.
1. Modify the
traefik_config.ymlFilecd /config/traefik/nanoeditor to open the file:storagesection for the SSL certificate and above thewebandwebsecuresections:Ctrl + Oand then pressingEnter.Ctrl + X.2. Modify the
docker-compose.ymlFiledocker-compose.ymlfile earlier.nano:image: fosrl/gerbil:1.0.0(or whatever version you have).ports:section:Ctrl + Oand then pressingEnter.Ctrl + X.3. Restart the Docker Containers
With these steps, you have successfully linked the Pangolin service on GCP to your local server via Traefik and
Step 11: Connecting the Server to a User
hbbrcontainer.Troubleshooting
Given the complexity of this setup, troubleshooting can be a bit challenging. The Pangolin tools do not provide built-in functionality to track connection status, so we will use some external commands to check for issues.
1. Verifying GCP Server Ports are open
To ensure that the ports are open on the Google Cloud server where Pangolin is running, you can use the
nmaptool.<GCP_VM_PUBLIC_IP>with the public IP address of your GCP virtual machine. If the ports are open, they will appear asopenin the command results.2. Verifying RustDesk Server Ports
You must ensure that the ports are open on the local server hosting the RustDesk containers.
If you see the ports open, it means the connection has been successfully established between GCP and your local server.
3. Checking
hbbrandhbbsContainer LogsYou can inspect the Docker container logs to ensure they are running and listening on the correct ports.
Look for log entries such as:
These messages confirm that the services are functioning correctly.
4. Restarting the
hbbrandhbbsContainersSometimes, restarting the containers after changing the settings can resolve the issue. Use the following command:
If the problem persists, the surest solution is to access your server and apply the settings manually. Follow the Instructions in Step 11 access your server after ensuring everything is working.
Beta Was this translation helpful? Give feedback.
All reactions