A comprehensive guide for setting up a DIY Game Server using Pelican Panel with Oracle Cloud and Cloudflare.
- A server to install the panel on
- A domain registered in Cloudflare
- An Oracle Account (preferably Pay as You Go) Documentation for Always Free Resources
Note: Some commands may require
sudo
. Use it whenever applicable to your situation.
Download from: Ubuntu Server Download Page
Steps vary based on your setup (Guide uses Proxmox)
sudo apt upgrade -y && sudo apt update -y
sudo apt -y install php8.3 php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip,intl,sqlite3} mariadb-server nginx tar unzip git netcat-openbsd resolvconf wireguard
- Image: Canonical Ubuntu 24.04
- Shape: Ampere VM.Standard.A1.Flex
- 2 cores
- 12GB Memory
sudo su
apt update -y && apt upgrade -y
apt install ufw -y
ufw allow 22 && ufw allow 25565 && ufw allow 58000
ufw enable
curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
./wireguard-install.sh
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
# Add xcaddy GPG key for secure package downloads:
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg
# Add the xcaddy repository to the system's sources list:
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-xcaddy.list
# Install xcaddy
apt update -y
apt install -y xcaddy
wget https://go.dev/dl/go1.23.3.linux-arm64.tar.gz
tar -C /usr/local -xzf go1.23.3.linux-arm64.tar.gz
# Add Go to your system's PATH to make it accessible from any directory
export PATH=$PATH:/usr/local/go/bin
# Apply the PATH changes by sourcing your profile:
source ~/.profile
# Check if go was installed successfully
go version
xcaddy build --with github.com/mholt/caddy-l4
mv caddy /usr/local/bin/
caddy -v
# Setup Caddy-l4
mkdir -p /etc/caddy
nano /etc/caddy/Caddyfile
Add to Caddyfile:
{
layer4 {
:25565 {
route {
proxy {
upstream 10.66.66.2:25565
}
}
}
}
}
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
nano /etc/systemd/system/caddy.service
Add to caddy.service:
[Unit]
Description=Caddy web server
Documentation=https://caddyserver.com/docs
After=network.target
[Service]
ExecStart=/usr/local/bin/caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile
ExecStop=/usr/local/bin/caddy stop
Restart=on-failure
LimitNOFILE=1048576
LimitNPROC=512
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable caddy
systemctl start caddy
systemctl status caddy
cd /home/ubuntu
ls
nano wg0-"your config name here".conf
sudo nano /etc/wireguard/wg0.conf
(copy and paste in the configuration in the VPS)
sudo nano /etc/systemd/system/wg-quick@.service
Add to wg-quick@.service:
[Unit]
Description=WireGuard via wg-quick(8) for %I
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/wg-quick up %i
ExecStartPost=/usr/bin/curl ifconfig.io
ExecStop=/usr/bin/wg-quick down %i
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable wg-quick@wg0.service
sudo systemctl start wg-quick@wg0.service
sudo systemctl status wg-quick@wg0.service
sudo apt install -y python3-certbot-nginx
sudo certbot -d example.com --manual --preferred-challenges dns certonly
sudo crontab -e
0 23 * * * certbot renew --quiet --deploy-hook "systemctl restart nginx"
This step requires you to follow the documentation here: https://pelican.dev/docs along with the video.
Use sudo with the curl command given in the Cloudflare Dashboard sudo curl -L --output cloudflared.dev [...]
Origin Server Name is the domain you used to make the certificates in #5.2
# VPS
reboot
# VM
sudo reboot
This step requires you to follow the documentation here: https://pelican.dev/docs along with the video.
Your Wireguard IP is always your primary allocation if you want other users to access your server. You can add your local IP as an additional allocation for local access if you want to.
Current github repository for eggs: https://github.com/pelican-eggs
ufw allow 16261 && ufw allow 16262
nano /etc/caddy/Caddyfile
(Replace "port" with your UDP port)
udp/:port {
route {
proxy {
upstream udp/10.66.66.2:port
}
}
}
Below is how the complete config would look like:
{
layer4 {
:25565 {
route {
proxy {
upstream 10.66.66.2:25565
}
}
}
udp/:16261 {
route {
proxy {
upstream udp/10.66.66.2:16261
}
}
}
udp/:16262 {
route {
proxy {
upstream udp/10.66.66.2:16262
}
}
}
}
}
Finally, reboot both machines once again.