Skip to content

RuiRC/CommandsForVideo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Prerequisites:

  • A Domain
  • An Oracle Account (preferably Pay as You Go)

Notes

  • Some commands may require you to use sudo, use it whenever applicable to your situation

Steps:

1 - Update the Host Machine

apt update -y && apt upgrade -y

2 - Install Basic Dependencies and Apps

apt install netcat-openbsd resolvconf wireguard curl sudo software-properties-common build-essential git -y

2.5 - (Optional/DO NOT DO) Enable Root SSH for Easy Configuration

nano /etc/ssh/sshd-config

3 - Enter Root in VPS

sudo su

4 - Update Machine and Install Nginx

apt update -y && apt upgrade -y && apt install nginx -y

5 - Download and Run the Wireguard Install Script

curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
./wireguard-install.sh

6 - Rename Your Client Config File to wg0.config

mv yourfilename.conf wg0.conf

7 - Edit the File and Add Keep Alive

Open wg0.conf and add:

nano wg0.conf

PersistentKeepalive = 25

8 - Edit Nginx Configuration File and Reload Nginx

nano /etc/nginx/nginx.conf

Add the following configuration:

stream {
    # TCP traffic on port 25565
    server {
        listen 25565;
        proxy_pass 10.66.66.2:25565;
        proxy_timeout 3s;
    }
}

Then test and reload Nginx:

nginx -t
systemctl reload nginx

9 - Allow Ports through Firewall

ufw allow 22 && ufw allow 25565 && ufw allow 58000
ufw enable

10 - Create Service File for Auto-Connection to Wireguard VPN

nano /etc/systemd/system/wg-quick@.service

Add the following content:

[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
ExecStartPost=/usr/bin/nc -vz 10.66.66.1 25565
ExecStop=/usr/bin/wg-quick down %i
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Enable and start the service:

systemctl enable wg-quick@wg0.service
systemctl start wg-quick@wg0.service
systemctl status wg-quick@wg0.service

11 - Workaround to Keep Nginx Alive

Create a timer:

nano /etc/systemd/system/nc-timer.timer

Add the following content:

[Unit]
Description=Run nc every 1 minute

[Timer]
OnCalendar=*:0/1
Persistent=true

[Install]
WantedBy=timers.target

Create a service:

nano /etc/systemd/system/nc-timer.service

Add the following content:

[Unit]
Description=Run nc command on port 25565

[Service]
Type=simple
ExecStart=/usr/bin/nc -vz 10.66.66.1 25565

Enable the timer:

systemctl enable --now nc-timer.timer

12 - Make OpenSSL Certs for Pelican Panel

mkdir -p /etc/certs
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=NA/ST=NA/L=NA/O=NA/CN=Generic SSL Certificate" -keyout /etc/certs/privkey.pem -out /etc/certs/fullchain.pem

13.1 - Follow the Pelican Documentation! Anything from the Documentation should be taken from it in the correct order

Refer to the Pelican Panel Documentation.

13.2 - Dependencies for Pelican

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

13.3 - Join the Pelican Panel Discord for Help

Join the Pelican Panel Discord.

14 - Tunnel Docker Command Edit

docker run -d --restart unless-stopped [rest of cloudflare stuff]

About

Commands for DIY Game Server Video

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published