- Create Lightsail instance with ubuntu 22
- Let instance boot up
- Go to Manage Instance - Networking, and add ports 443 and 10000 to firewall rules
- Copy the IP for the Instance
You can also have a domain name which point to the instance so users can acess it via a URL rather than an IP address.
- Go to your domain registras admin panel for DNS settings
- Create two A NAME records for
dcl-test.domain.tld, and*.dcl-test.domain.tldwhich point to the Lightsail Instance IP - Set these up now so that DNS has time to propagate before we request SSL certificates later
Update the following with your own details and run them in your terminal so we can reference the values later:
declare DOMAIN="dcl-test.domain.tld"
declare SUDO_USER_PASSWORD="AReallySuperSecretPasswordForTheAdminPanel"
Run following in terminal to setup system setup:
# Update packages
sudo apt update -y
sudo apt install -y git tmux npm
# Set sudo user passwd
echo "ubuntu:${SUDO_USER_PASSWORD}" | sudo chpasswd
# Preserve hostname on AWS instances
hostnamectl set-hostname --static "${DOMAIN}"
echo "preserve_hostname: true" | sudo tee -a "/etc/cloud/cloud.cfg" > /dev/null
systemctl restart NetworkManager
# Get virtualmin and run installer
wget https://software.virtualmin.com/gpl/scripts/virtualmin-install.sh
sudo sh virtualmin-install.sh --minimal --hostname "${DOMAIN}" --force
# Set some Virtualmin options
sudo virtualmin set-global-feature --default-off virtualmin-awstats
sudo virtualmin disable-feature --mysql --all-domains
sudo virtualmin disable-feature --mail --all-domains
sudo systemctl disable mariadb
sudo systemctl disable postfix
sudo systemctl disable dovecot
Run the following in terminal:
# Create the website for the domain with a random admin password
webmin_password=$(date +%s|sha256sum|sha256sum|base64|head -c 32)
sudo virtualmin create-domain --domain "${DOMAIN}" --pass "${webmin_password}" --default-features
Run the following in a termainl. It must be run with sudo, so must be run under the sudo account, eg ubuntu
This may not work if DNS changes haven't propagated yet, so if it fails due to lack of DNS records try again later.
sudo virtualmin generate-letsencrypt-cert --domain "${DOMAIN}"
sudo virtualmin install-service-cert --domain "${DOMAIN}" --service webmin
Next, we switch over to the newly created user account.
- Note: you will need to update the username.
Your username is the first part of your domain, eg dcl-test
sudo su dcl-test
cd ~
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
- We need to copy the public key here to your GitHub authorised keys so that the user account has permission to clone repositories.
- Run the following to print out the public key of the newly generated keypair:
tail ~/.ssh/id_ed25519.pub
- Go to GitHub -> Settings -> Access -> SSH and GPG Keys -> Add SSH Key
- Enter the public key and save
Run the following in terminal:
# Fetch and install NVM
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
# Reload bashrc
exec bash
# Install NodeJS v18
nvm install 18
nvm use 18
# Install DCL for user
npm install -g decentraland
This redirects requests to the website to the DCL instance when it's running. This is easiest to do via the Virtualmin admin panel.
- The Virtualmin Admin panel is located at: https://domain.tld:10000
- Log in to the admin panel and run the first time setup: We don't need a database, mail capabilities, spam or AV.
- Go to Virtualmin -> Domain -> Services -> Configure Website -> Edit Directives -> Append the following to the bottom of the file:
# Proxy configuration
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8008/
ProxyPassReverse / http://127.0.0.1:8008/
ProxyPassReverseCookieDomain DOMAINNAME.COM localhost
# WebSocket support
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:8008/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://127.0.0.1:8008/$1 [P,L]
- Save and close the file
- Click "Apply Changes" at the top right to restart Apache and reload the directives
-
Go back to the terminal
-
Ensure you're logged in as the website user, eg
dcl-test -
Run the following in the terminal:
# Clone the repository
git clone [email protected]:stom66/dcl-vroomway-solosprint-2.git
# CD to the repo dir
cd dcl-vroomway-solosprint-2/dcl-scene
# Launch the instance and attach it to a tmux screen:
tmux new-session -d -s dcl "dcl start --port 8008 --no-debug --no-browser --no-watch"