<< BACK_TO_LOGS

Reclaiming your Chat

DATE: 02-15-2026TAGS:#how-to#self-host

Reclaiming your Chat: A Guide to Self-Hosting Sharkord

The golden age of centralized communication is ending. Discord, once the undisputed sanctuary for gamers and niche communities, has entered the terminal phase of "enshittification." What began as a lightweight tool for connectivity has morphed into a platform obsessed with aggressive monetization—locking core features behind Nitro paywalls and, more alarmingly, trading user privacy for intrusive biometric "verification" measures.

When a platform prioritizes infinite growth over user experience, the only logical move is to exit.

Enter Sharkord. As a robust, open-source, and self-hosted alternative, Sharkord shifts the power dynamic back to the user. No more corporate data-mining, no mandatory facial scans, and no arbitrary feature-gating. You own the data; you own the hardware.

In this guide, we’ll move beyond basic setups and deploy a professional Split Server architecture, ensuring your instance is secure, scalable, and entirely under your command. You'll get experience setting up an application server, configuring firewall rules, configuring a reverse proxy server, and more.


The Architecture

  • Server 1 (Reverse Proxy): Handles SSL (HTTPS) and forwards web traffic.

  • Example Internal IP: 192.168.1.10

  • Server 2 (App Server): Runs the Sharkord application.

  • Example Internal IP: 192.168.1.20

  • Traffic Flow:

  • Text/Web: Internet Reverse Proxy (443) App Server (4491)

  • Voice (UDP): Internet App Server (40000-40020) [Bypasses Proxy]


Phase 1: DNS & Router Configuration

Before touching the servers, configure your network to direct traffic correctly.

  1. DNS Records (Domain):
  • Create an A Record for your domain (e.g., chat.example.com).
  • Point it to your Public Home IP Address.
  1. Port Forwarding (Router/Firewall):
  • TCP Ports 80 & 443: Forward to Reverse Proxy (192.168.1.10)
  • UDP Ports 40000-40020: Forward to App Server (192.168.1.20)
  • Critical: The UDP ports are required for voice chat. If you skip this, you can type but not talk.

Phase 2: The Application Server

Goal: Install Sharkord, configure the firewall, and get your Access Token.

1. Configure Firewall (UFW)

We must open ports for SSH (management), the Web App, and Voice traffic.

sudo ufw allow 22/tcp            # SSH
sudo ufw allow 4491/tcp          # Sharkord Web Interface
sudo ufw allow 40000:40020/udp   # Voice Traffic
sudo ufw enable

2. Install Sharkord

Run these commands to download the application and make it executable:

curl -L https://github.com/sharkord/sharkord/releases/latest/download/sharkord-linux-x64 -o sharkord
chmod +x sharkord

3. First Run & Token Generation

Run the application manually the first time to generate your configuration and Access Token.

./sharkord

IMPORTANT: Look at the output! It will display an Access Token (a long string of characters). Copy and save this token now. You will need it to log in for the first time.

Press Ctrl+C to stop the server once you have the token.

(Note: If you ever need to manually edit settings, the config file is located at ~/.config/sharkord/config.ini. By default, it uses port 4491, so no changes are usually needed.)

4. Create the Service

Set Sharkord to run automatically in the background. sudo nano /etc/systemd/system/sharkord.service

Paste this config (replace your-username with your actual Linux user):

[Unit]
Description=Sharkord Chat Service
After=network.target

[Service]
Type=simple
# REPLACE 'your-username' WITH YOUR ACTUAL LINUX USERNAME
User=your-username
Group=your-username
WorkingDirectory=/home/your-username

# Path to the executable we downloaded
ExecStart=/home/your-username/sharkord

# Auto-restart if it crashes
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

5. Enable and Start

sudo systemctl daemon-reload
sudo systemctl enable sharkord
sudo systemctl start sharkord

Phase 3: The Reverse Proxy

Goal: Receive web traffic, secure it with SSL, and pass it to the App Server.

1. Configure Firewall (UFW)

sudo ufw allow 22/tcp    # SSH
sudo ufw allow 80/tcp    # HTTP (Certbot)
sudo ufw allow 443/tcp   # HTTPS
sudo ufw enable

2. Install Nginx & Certbot

sudo apt update
sudo apt install nginx certbot python3-certbot-nginx -y

3. Create Site Config

sudo nano /etc/nginx/sites-available/chat.example.com

Paste this config. Crucial: Update server_name to your domain and proxy_pass to your App Server's IP.

server {
    listen 80;
    server_name chat.example.com;

    # Basic logging
    access_log /var/log/nginx/chat.access.log;
    error_log /var/log/nginx/chat.error.log;

    location / {
        # Point to the App Server IP (Use the default port 4491)
        proxy_pass http://192.168.1.20:4491;

        # WebSocket Support (REQUIRED for chat)
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Forward real IP information
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Timeouts (Prevents disconnection/1006 errors)
        proxy_read_timeout 86400s;
        proxy_connect_timeout 86400s;
    }
}

4. Enable the Site

sudo ln -s /etc/nginx/sites-available/chat.example.com /etc/nginx/sites-enabled/
sudo nginx -t  # Test config syntax
sudo systemctl reload nginx

5. Get SSL (HTTPS)

Run Certbot to automatically secure the site.

sudo certbot --nginx -d chat.example.com

Select option 2 (Redirect) to force HTTPS.


Phase 4: First Login (Token Setup)

Now that everything is running, go to your domain (e.g., https://chat.example.com) in your web browser.

  1. You will see the Sharkord interface.
  2. Open your Browser's Developer Console (Press F12 or right-click > Inspect > Console).
  3. Type the following command using the token you saved in Phase 2:
useToken("your_token_here")
  1. Press Enter. The page should refresh or log you in as the owner.

Phase 5: Creating a Desktop App (Optional)

If you prefer a standalone desktop application instead of using a browser tab, you can turn your new website into an app using Pake.

1. Prerequisites (Windows)

You must install the Visual Studio Build Tools for Pake to compile correctly.

  1. Download from Visual Studio Downloads.
  2. Run the installer and ensure you select "Desktop development with C++".

2. Install Pake

(Requires Node.js/npm installed on your computer)

npm install -g pake-cli

3. Build the App

Run this command to generate the Sharkord desktop app. Replace the URL with your actual domain.

pake "https://chat.example.com" --name "Sharkord"

Note: You can customize the name (e.g., "MyChat") or icon if desired.

This will create a .exe (or .app / .deb depending on your OS) that you can distribute to your users!