Before you start
- You need a Google account (opens in a new tab) with an active GCP billing account
Quick deploy — One click
Click the button below to open Google Cloud Shell with the deployment guide pre-loaded. No manual setup required — Cloud Shell clones the repo and walks you through each step.
What happens: Cloud Shell opens in your browser, clones the rtSurvey repo, and displays a step-by-step tutorial panel. Each command is clickable — no typing required. Setup takes 5–10 minutes.
Prefer to deploy manually via the GCP Console? Follow the steps below.
Step 1 — Create a GCP account
Go to console.cloud.google.com (opens in a new tab) and sign in with your Google account. Ensure a billing account is linked before proceeding.
Step 2 — Create a project
- Go to console.cloud.google.com (opens in a new tab)
- Click the project dropdown at the top → New Project
- Enter a name (e.g.
rtsurvey) → Create - Select the new project from the dropdown
Step 3 — Enable Compute Engine API
Go to Compute Engine API (opens in a new tab) → click Enable
Wait about 1 minute for GCP to provision the API.
Step 4 — Create a VM instance
- Go to Compute Engine → VM instances → Create Instance
- Fill in the form:
| Field | Recommended value |
|---|---|
| Name | rtsurvey-prod |
| Region | Closest to your users (e.g. asia-east1 for Southeast Asia) |
| Machine type | e2-medium (2 vCPU / 4 GB RAM) |
| Boot disk | Click Change → Ubuntu 22.04 LTS → 20 GB → Select |
| Firewall | ✅ Allow HTTP traffic ✅ Allow HTTPS traffic |
- Click Advanced options → Management → scroll to Automation
- Paste the bootstrap snippet below into the Startup script field:
#!/bin/bash
export PROJECT_ID="rtsurvey"
export ADMIN_PASSWORD="admin"
export EMBED_KEYCLOAK="true"
export TZ="Asia/Ho_Chi_Minh"
curl -fsSL https://raw.githubusercontent.com/therealtimex/rtsurvey/main/scripts/gcp-compute.sh | bash- Click Create
Customise: Change the
exportlines to set your own project ID, password, timezone, etc. before clicking Create.
Full script (for review or gcloud CLI upload): gcp-compute.sh (opens in a new tab)
Recommended VM sizes
| Machine type | RAM | ~$/month | Notes |
|---|---|---|---|
e2-medium | 4 GB | ~$27 | Minimum for Keycloak |
e2-standard-2 | 8 GB | ~$49 | Recommended for production |
Step 5 — Open port 3838 (Shiny)
GCP's Allow HTTP/HTTPS checkboxes only open ports 80 and 443. Port 3838 (Shiny analytics) requires a separate rule.
- Go to VPC network → Firewall → Create firewall rule
- Fill in the rule:
| Field | Value |
|---|---|
| Name | allow-shiny-3838 |
| Direction | Ingress |
| Action | Allow |
| Targets | All instances in the network |
| Source IPv4 ranges | 0.0.0.0/0 |
| Protocols and ports | TCP 3838 |
- Click Create
Step 6 — Wait for setup to complete
The script runs automatically on first boot. It installs Docker, pulls the rtSurvey image, initialises the database, and starts all services. This takes 5–10 minutes.
No console access needed. Open your browser and go to http://<vm-external-ip>. You will see a loading page while the app finishes starting up. It refreshes automatically every 5 seconds and loads the app once ready.
The VM external IP is shown in the Compute Engine → VM instances list.
To watch the log directly:
ssh <user>@<vm-external-ip>
sudo tail -f /var/log/rtsurvey-setup.logStep 7 — Set up SSL
Once the app is running, follow the Set Up SSL guide → to configure HTTPS. The free rtsurvey.com subdomain is the fastest option — no DNS setup needed.
Step 8 — Change the default password
All passwords default to admin. Change them immediately after your first login:
- App admin password — account settings inside the app
- Keycloak admin — accessible at
https://your-domain.com/auth/admin(login:admin/admin)
Firewall rules (GCP VPC)
The startup script configures ufw inside the VM. You also need these VPC-level firewall rules in GCP:
Inbound
| Rule name | Protocol | Port | Notes |
|---|---|---|---|
default-allow-ssh | TCP | 22 | SSH access (GCP default) |
default-allow-http | TCP | 80 | Nginx HTTP + ACME challenge |
default-allow-https | TCP | 443 | Nginx HTTPS after SSL setup |
allow-shiny-3838 | TCP | 3838 | Shiny Server (R analytics) |
Ports NOT needed externally
| Port | Service | Reason |
|---|---|---|
| 8080 | App container | Nginx proxies to it internally |
| 8090 | Keycloak container | Nginx proxies to it internally |
| 3306 | MySQL | Internal Docker network only |
Troubleshooting
Check the setup log
sudo tail -200 /var/log/rtsurvey-setup.logCheck the SSL log
sudo tail -200 /var/log/rtsurvey-ssl.logView container status
docker compose -f /opt/rtsurvey/docker-compose.production.yml psReboot behavior
GCP reruns the startup script on every VM reboot. The script detects an existing installation at /opt/rtsurvey/ and exits immediately — no re-provisioning occurs.