You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide supports both AWS EC2 and Azure VM with Terraform.
Prepare Repository
# Local and VM# Clone repository
git clone https://github.com/Arata1202/WorkAdventure.git
cd WorkAdventure
# Install dependencies
make wa-init
Create Resources with Terraform
# Local# Move to repositorycd WorkAdventure
cd terraform/aws # or terraform/azure# Prepare and edit local values
cp terraform.tfvars.example terraform.tfvars
vi terraform.tfvars
# Create resources
terraform init
terraform plan
terraform apply
Connect AWS EC2 with SSM
Default for AWS is SSM.
# Local# Configure AWS CLI credentials and region before connecting
aws configure
# Connect to AWS EC2 via SSM
aws ssm start-session --target <EC2_INSTANCE_ID># Switch to ubuntu user
sudo -iu ubuntu
Configure SSH Access
Default for Azure is SSH (Azure Bastion can be costly).
# Local# Save the VM private key
vi ~/.ssh/workadventure_key.pem
chmod 600 ~/.ssh/workadventure_key.pem
# Configure SSH host aliases
vi ~/.ssh/config
# VM# Set up Ubuntu
./ubuntu/setup.sh
# Move to repositorycd WorkAdventure
# Remove existing .env file
rm -f .env
# Generate random strings for .env values
openssl rand -hex 16
openssl rand -hex 32
# Prepare and edit .env file
cp .env.example .env
vi .env
# Encrypt .env file
make encrypt
# Start services with the basic configuration.# For production, prefer the recommended initial production setup in this section.
make up
Add an A record in your DNS provider to point your domain to the VM public IP
Record Name
Type
Value
TTL
<YOUR_FQDN>
A
<VM_PUBLIC_IPV4_ADDRESS>
300
Recommended Initial Production Setup
Use this flow for a new production server before the first start.
Start from a clean .env, add all values from the sections you plan to use, then start the stack once.
Run the Synapse commands only when Matrix is configured.
# VM# Move to repositorycd WorkAdventure
# Prepare a clean .env file for initial setup
rm -f .env
cp .env.example .env
# Edit .env once with all values from the sections you plan to use
vi .env
# Encrypt .env file
make encrypt
# Prepare Synapse data volume when Matrix is enabled
npx dotenvx run -- docker compose run --rm --user root --entrypoint sh synapse -lc 'chown -R 991:991 /data'# Start services with the completed .env
make up-f
# Create a Matrix Admin User when Matrix is enabled
npx dotenvx run -- sh -lc 'docker compose exec synapse register_new_matrix_user -c /data/homeserver.yaml -u "$MATRIX_ADMIN_USER" -p "$MATRIX_ADMIN_PASSWORD" --admin http://localhost:8008'
Edit .env file for basic settings
# VM# Move to repositorycd WorkAdventure
# Edit .env file
make decrypt
vi .env
make encrypt
# Restart server
make up-f
# Local# Move to repositorycd WorkAdventure
# Prepare .env file
cp maps/.env.example maps/.env
# Preview the map locally
make wa-dev
# Edit the map file (maps/office.tmj) using Tiled# Upload the map
make wa-upload
Please enter your Map storage URL: https://<YOUR_FQDN>/map-storage/
Please enter your API Key: <MAP_STORAGE_AUTHENTICATION_TOKEN>
Upload directory: maps
# VM# Move to repositorycd WorkAdventure
# Edit .env file
make decrypt
vi .env
make encrypt
# Restart server
make up-f
# VM# Move to repositorycd WorkAdventure
# Generate random strings for .env values
openssl rand -hex 32
# Edit .env file
make decrypt
vi .env
make encrypt
# Restart server
make up-f
Add an A record in your DNS provider to point your domain to the VM public IP
Record Name
Type
Value
TTL
livekit.<YOUR_FQDN>
A
<VM_PUBLIC_IPV4_ADDRESS>
300
Set Up Coturn
# VM# Move to repositorycd WorkAdventure
# Generate random strings for .env values
openssl rand -hex 32
# Edit .env file
make decrypt
vi .env
make encrypt
# Restart server
make up-f
Add an A record in your DNS provider to point your domain to the VM public IP
Record Name
Type
Value
TTL
matrix.<YOUR_FQDN>
A
<VM_PUBLIC_IPV4_ADDRESS>
300
Log in to Matrix using Element
Access Element Web: https://element.io
Click Sign in -> Open Element web
Click Sign in
Enter your Matrix homeserver URL: https://matrix.<YOUR_FQDN>
Click Continue
Enter your Matrix credentials:
Username: admin
Password: <MATRIX_ADMIN_PASSWORD>
Click Sign in
After successful authentication, you will be redirected back to Element and logged in
Set Up Egress with RustFS
# VM# Move to repositorycd WorkAdventure
# Generate random strings for .env values
openssl rand -hex 32
# Edit .env file
make decrypt
vi .env
make encrypt
# Restart server
make up-f