Showing all sections. Press / to focus search.
Server Setup

Steal Brainrot From Tsunami deployment documentation

This page walks you through the full handoff: prepare the server, create DNS records, run setup.sh, verify HTTPS and worker routing, then update the exported HTML5 package by editing game-config.json next to index.html.

1 Start Here

What You Need

Use a fresh Ubuntu server and a domain that can create multiple subdomains pointing to the same machine.

  • Ubuntu 22.04 or 24.04
  • A domain with DNS access
  • A sudo user on the server
2 Before Running Setup

How Domains Work

Before you start, you need to create DNS records on your domain provider, depending on how many CPU cores you want to use. The setup expects the main entry domain and each worker domain to point to the same server IP.

  • NUM_CPUS=1 -> create tsunami.example.com and tsunami1.example.com
  • NUM_CPUS=2 -> create tsunami.example.com, tsunami1.example.com, and tsunami2.example.com
  • NUM_CPUS=3 -> create tsunami.example.com, tsunami1.example.com, tsunami2.example.com, and tsunami3.example.com

How To Add A Records

Create A records in your DNS provider. If you use Cloudflare, keep each record on DNS only with the gray cloud, and also set SSL/TLS encryption mode to Full (strict) in Cloudflare -> domain -> SSL/TLS -> Overview. Do not enable the proxy for this setup.

Cloudflare DNS Only
3 Prepare The Server

Fastest Installation Path

This is the clean handoff sequence for a fresh server.


curl -fsSL https://get.docker.com | sh && sudo apt update && sudo apt install git dnsutils certbot -y

https://github Multiplayer feature is only available for Extended License holders. If you have purchased an Extended License, reach out to info@zupga.com and access to the multiplayer backend GitHub repo will be provided. 

cd Tsunami
cp docs/customer-deployment/.env.example .env
nano .env

Example .env Content

NUM_CPUS=3
BASE_DOMAIN=yourdomain.com
EMAIL=admin@yourdomain.com
MONGO_USER=admin
MONGO_PASSWORD=change-this-mongo-password
MONGO_DB=tsunamiDB
REDIS_PASSWORD=change-this-redis-password
JWT_SECRET=replace-with-openssl-rand-base64-32

When you finish editing in nano, press Ctrl+X, then Y, then Enter to save and exit.

Generate JWT Secret

openssl rand -base64 32
4 Run The Deployment

Run setup.sh

1. Confirm DNS is ready Make sure tsunami.example.com, tsunami1.example.com, and any other worker domains already point to the server before continuing.
2. Start the script
chmod +x setup.sh
./setup.sh
3. Let the script finish The script installs packages, requests SSL, generates Nginx and Docker Compose config, creates the Docker network, and starts the full stack.
4. Wait for the containers to settle After a rebuild, give the game servers a short moment to finish booting before testing joins.
5 Verify Everything

Check That The Deployment Worked

Once setup.sh finishes, verify the stack, HTTPS, and worker routing before handoff.

  • Run 'docker ps' and confirm every container is up
  • Run curl https://tsunami.yourdomain.com
  • Run curl https://tsunami1.yourdomain.com
  • Confirm each response returns 'OK'
  • Confirm the main entry domain is tsunami.yourdomain.com
6 Before Shipping

Update The Exported HTML5 Client Package

Open the exported HTML5 folder that contains index.html. In that same folder, edit game-config.json and change the domain value to your entry domain.

{
  "domain": "tsunami.yourdomain.com",
  "version": "1.0.0"
}
  • Use tsunami.yourdomain.com
  • Do not use worker domains like tsunami1.yourdomain.com
Cloudflare DNS Only
7Shipping

Upload The Exported HTML5 Package to your Web Server

After updating the domain in game-config.json, upload the entire HTML5 export package to your web server. This typically involves using FTP/SFTP or a file manager provided by your hosting service.

Test it if the game loads correctly and can connect to the backend services using the new domain configuration. If the game correctly spawns your character, the deployment is successful and your servers are up and running.