Skip to content

organicnz/egames-remnawave-supabase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Remnawave Installation Script with Supabase Support

An automated installation script for deploying Remnawave VPN panel infrastructure with Supabase PostgreSQL database support.

Overview

This script is a customized fork of the official Remnawave reverse-proxy installer that replaces the default local PostgreSQL container with Supabase cloud database. This provides several advantages:

  • Managed Database: No need to maintain PostgreSQL yourself
  • Automatic Backups: Supabase handles database backups
  • Scalability: Easy to scale database resources as needed
  • High Availability: Built-in redundancy and reliability
  • Cost Effective: Free tier available for small deployments

Prerequisites

Server Requirements

  • OS: Debian 11/12 or Ubuntu 22.04/24.04
  • Architecture: x86_64 or ARM64
  • RAM: Minimum 1GB (2GB+ recommended)
  • Disk: 10GB+ free space
  • Root Access: Required
  • Network: Public IP address with ports 80, 443, and 2222 accessible

Domain Requirements

You need three domains or subdomains with DNS configured:

  1. Panel Domain: Admin panel access (e.g., panel.yourdomain.com)
  2. Subscription Domain: User subscription endpoint (e.g., sub.yourdomain.com)
  3. Node Domain: Traffic proxy "camouflage" domain (e.g., node.yourdomain.com)

All domains must point to your server's IP address via A records.

Supabase Setup

Before running the script, you need to set up a Supabase database:

Step 1: Create Supabase Project

  1. Go to supabase.com and sign up/login

  2. Click "New Project"

  3. Choose an organization

  4. Enter project details:

    • Name: Choose any name (e.g., "remnawave-db")
    • Database Password: Create a strong password (save this!)
    • Region: Choose closest to your server (e.g., EU Central for AWS Frankfurt)
    • Pricing Plan: Free tier works for small deployments
  5. Wait for project to be created (~2 minutes)

Step 2: Get Database Credentials

  1. In your Supabase project dashboard, go to SettingsDatabase

  2. Scroll down to Connection String section

  3. Select Connection PoolingSession mode

  4. You'll see a URL like:

    postgresql://postgres.abcdefghijklmnop:[YOUR-PASSWORD]@aws-1-eu-central-1.pooler.supabase.com:5432/postgres
    
  5. Extract these values:

    • Project Identifier: The part after postgres. and before :[YOUR-PASSWORD]
      • Example: abcdefghijklmnop
    • Database Password: The password you set when creating the project

Important Notes:

  • Use the Connection Pooling URL (with pooler.supabase.com), NOT the direct connection
  • Make sure to use Session mode pooling
  • Save both the project identifier and password - you'll need them during installation

Step 3: Enable Required Extensions (Optional)

The Remnawave application may require certain PostgreSQL extensions. In Supabase:

  1. Go to DatabaseExtensions
  2. Enable these extensions if needed:
    • uuid-ossp: UUID generation
    • pgcrypto: Cryptographic functions

Installation

One-Line Install (Recommended)

The fastest way to install:

sudo bash <(curl -Ls https://raw.githubusercontent.com/organicnz/egames-remnawave-supabase/main/install_remnawave.sh)

This command downloads and executes the script directly without saving it locally.

Alternative: Download and Run

If you prefer to download the script first:

# Download the script
wget https://raw.githubusercontent.com/organicnz/egames-remnawave-supabase/main/install_remnawave.sh

# Make it executable
chmod +x install_remnawave.sh

# Run as root
sudo bash install_remnawave.sh

Installation Wizard

The script will guide you through an interactive installation process:

1. Language Selection

Choose your preferred language:

  • 1 - English
  • 2 - Русский (Russian)

2. Installation Mode

Select one of the following installation modes:

Option 1: Install Panel and Node on One Server

  • Complete installation with admin panel and node on same server
  • Recommended for single-server deployments
  • Requires all three domains

Option 2: Install Only the Panel

  • Just the admin panel without node
  • Use this if you want to add nodes on separate servers later
  • Requires panel and subscription domains

Option 3: Add Node to Panel

  • Add additional node to existing panel
  • Run this on a separate node server
  • Requires connection to existing panel

Option 4: Install Only the Node

  • Standalone node installation
  • For advanced multi-server setups

3. Domain Configuration

Enter your three domains when prompted:

Enter panel domain: panel.yourdomain.com
Enter subscription domain: sub.yourdomain.com
Enter selfsteal domain for node: node.yourdomain.com

4. Supabase Credentials

This is the key difference from the standard installation:

When prompted, enter your Supabase credentials:

Enter Supabase project identifier: abcdefghijklmnop
Enter Supabase database password: [your-password]
  • Project Identifier: Just the ID part (e.g., abcdefghijklmnop)
    • NOT postgres.abcdefghijklmnop
    • The script automatically adds the postgres. prefix
  • Database Password: The password from your Supabase project

5. Certificate Generation

The script will automatically:

  • Install Certbot
  • Generate Let's Encrypt SSL certificates for your domains
  • Configure Nginx with HTTPS

6. Automated Setup

The script will automatically:

  • Install Docker and required packages
  • Pull Remnawave Docker images
  • Generate secure credentials (JWT secrets, admin password, etc.)
  • Create Docker Compose configuration
  • Start all services
  • Register initial superadmin account

Installation Complete

After successful installation, you'll see:

=================================================
               INSTALLATION COMPLETE!
=================================================
Panel URL:
https://panel.yourdomain.com/auth/login?[auth-cookie]

To log into the panel, use the following data:
Username: [generated-username]
Password: [generated-password]
-------------------------------------------------
To relaunch the manager, use the following command:
remnawave_reverse
=================================================

Important: Save these credentials immediately! They are shown only once.

Post-Installation

Accessing the Panel

  1. Open the panel URL shown after installation
  2. Login with the provided credentials
  3. Configure your VPN settings, protocols, and users

Managing the Installation

After installation, you can manage your Remnawave installation using:

remnawave_reverse

Or directly via the script:

sudo bash install_remnawave.sh

The management menu provides options for:

  • Starting/stopping services
  • Updating panel and nodes
  • Viewing logs
  • Managing certificates
  • Adding additional nodes
  • Managing IPv6
  • Installing custom templates

Docker Commands

Manual service management:

# Navigate to installation directory
cd /opt/remnawave

# View running containers
docker compose ps

# View logs
docker compose logs -f remnawave
docker compose logs -f remnawave-redis
docker compose logs -f remnawave-nginx

# Restart services
docker compose restart

# Stop services
docker compose down

# Start services
docker compose up -d

Configuration Files

Important files location:

  • Installation directory: /opt/remnawave/
  • Environment variables: /opt/remnawave/.env
  • Docker Compose: /opt/remnawave/docker-compose.yml
  • Nginx config: /opt/remnawave/nginx.conf
  • SSL certificates: /etc/letsencrypt/live/[your-domain]/

Database Connection

The script creates a DATABASE_URL in the following format:

postgresql://postgres.[PROJECT_ID]:[PASSWORD]@aws-1-eu-central-1.pooler.supabase.com:5432/postgres?sslmode=require

Example:

postgresql://postgres.abcdefghijklmnop:mySecurePassword123@aws-1-eu-central-1.pooler.supabase.com:5432/postgres?sslmode=require

Note: The region (aws-1-eu-central-1) in the connection string should match your Supabase project region. If your Supabase project is in a different region, you'll need to modify the script or manually update the .env file after installation.

Troubleshooting

Common Issues

1. "Cannot connect to database"

  • Verify Supabase credentials are correct
  • Check that you're using the Connection Pooling URL
  • Ensure your server can reach Supabase (check firewall)
  • Verify the region in DATABASE_URL matches your Supabase project

2. "Domain not resolving"

  • Wait for DNS propagation (up to 48 hours, usually minutes)
  • Verify A records point to correct IP: dig +short yourdomain.com
  • Try accessing via IP temporarily to test installation

3. "Certificate generation failed"

  • Ensure ports 80 and 443 are accessible
  • Check DNS is properly configured
  • Verify no other web server is using these ports

4. "Docker errors"

  • Ensure system is up to date: apt update && apt upgrade
  • Check Docker service: systemctl status docker
  • Review logs: journalctl -u docker

Checking Logs

# Panel logs
docker compose -f /opt/remnawave/docker-compose.yml logs remnawave

# Database connection issues
docker compose -f /opt/remnawave/docker-compose.yml logs remnawave | grep -i database

# All services
docker compose -f /opt/remnawave/docker-compose.yml logs -f

Manual Database Connection Test

Test Supabase connection from your server:

# Install PostgreSQL client
apt install postgresql-client -y

# Test connection (replace with your credentials)
psql "postgresql://postgres.abcdefghijklmnop:password@aws-1-eu-central-1.pooler.supabase.com:5432/postgres?sslmode=require"

Reinstallation

If you need to reinstall:

# Stop and remove containers
cd /opt/remnawave
docker compose down -v

# Remove installation directory
rm -rf /opt/remnawave

# Re-run installation script
sudo bash install_remnawave.sh

Note: This does NOT delete your Supabase database. Your data remains safe in Supabase.

Security Considerations

  • Database Password: Never commit or share your Supabase password
  • Admin Credentials: Change the auto-generated admin password after first login
  • Firewall: Use UFW or iptables to restrict access
  • Updates: Keep system and Docker images updated
  • Backups: Supabase handles database backups, but export configs periodically
  • SSL Certificates: Auto-renewed by Certbot, check expiration: certbot certificates

Updating

To update Remnawave to the latest version:

# Run management script
remnawave_reverse

# Select: "3. Manage panel/node"
# Then: "3. Update panel/node"

This pulls the latest Docker images and restarts services.

Support

License

This script is based on the original Remnawave installation script by eGamesAPI. Please refer to the original project for licensing information.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Changelog

v2.2.1-supabase

  • Modified to support dynamic Supabase database credentials
  • Added prompts for DB_PROJECT_ID and DB_PASSWORD during installation
  • Removed hardcoded database credentials
  • Added bilingual support for Supabase credential prompts (EN/RU)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages