Deployment Guide

Deploy your ZygnalBot to various cloud platforms with these simple steps

01

Railway Setup

Visit railway.app to get started:

  • Create an account or log in
  • Click "New Project" button
  • Select "Deploy from GitHub repo"

Note: Railway offers a free tier with $5 of usage per month.

02

GitHub Repository

  • Create a new private repository
  • Upload all your project files
  • Include your .env file with configurations
  • Make sure all dependencies are included
$ git push origin main
03

Link Repository

  • Click "Connect Repository" in Railway
  • Select your GitHub repo from the list
  • Authorize Railway access to your GitHub
  • Wait for initial deployment to complete
04

Configure Deployment

  • Go to Settings in your Railway project
  • Find the Deploy section
  • Set the start command to run your bot:
$ python Main_bot_3.py
01

GCP Setup

Visit cloud.google.com to get started:

  • Create a Google Cloud account
  • Set up billing (required, but has free tier)
  • Create a new project from the dashboard

Note: GCP offers a generous free tier and $300 in credits for new users.

02

Cloud Run Setup

  • Navigate to Cloud Run in the GCP console
  • Click "Create Service"
  • Choose "Continuously deploy from source repository"
  • Connect to your GitHub repository
03

Configure Dockerfile

Create a Dockerfile in your repository:

# Dockerfile
FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "Main_bot_3.py"]
04

Environment Variables

  • In Cloud Run service settings, add your environment variables
  • Include your Discord bot token and other required variables
  • Set memory allocation to at least 512MB
  • Set CPU allocation based on your bot's needs
$ gcloud run deploy --image gcr.io/PROJECT_ID/IMAGE_NAME
01

Heroku Setup

Visit heroku.com to get started:

  • Create a Heroku account
  • Install the Heroku CLI on your computer
  • Create a new app from the dashboard

Note: Heroku's free tier has been discontinued. Basic plans start at $5/month.

02

Required Files

Add these files to your repository:

  • requirements.txt - List all Python dependencies
  • runtime.txt - Specify Python version
  • Procfile - Define the startup command
# Procfile
worker: python Main_bot_3.py
03

Deploy to Heroku

Use Git to deploy your bot:

$ heroku login
$ git add .
$ git commit -m "Deploy to Heroku"
$ git push heroku main
04

Configure Environment

  • Go to Settings tab in your Heroku app
  • Click "Reveal Config Vars"
  • Add your bot token and other environment variables
  • Scale your worker dyno to run the bot
$ heroku ps:scale worker=1
01

Azure Setup

Visit azure.microsoft.com to get started:

  • Create a Microsoft Azure account
  • Navigate to Azure Portal
  • Create a new resource group

Note: Azure offers a free tier with $200 credit for 30 days.

02

App Service Setup

  • Create a new App Service
  • Select Python as the runtime stack
  • Choose your resource group
  • Select a pricing tier (Free tier is sufficient for testing)
03

Deployment Center

  • Go to Deployment Center in your App Service
  • Select GitHub as the source
  • Connect to your GitHub repository
  • Configure the build provider (Kudu)
04

Configuration

  • Go to Configuration in your App Service
  • Add application settings for your environment variables
  • Set the startup command in General Settings
# startup.txt
python Main_bot_3.py

Version Updates

When updating your bot to a new version, follow these steps:

First, export your current configuration:

!exportconfig
  1. Request the latest version via ticket in the support server or on The Website
  2. Replace your current .py files with the updated versions | If changes in the requirements.txt also replace this!
  3. Push changes to your GitHub repository
  4. Your cloud provider will automatically detect changes and redeploy

After deployment completes, import your settings:

!importconfig <json file>

This ensures all your custom settings, roles, and configurations are preserved during updates.

Troubleshooting

  • Check deployment logs if your bot fails to start
  • Ensure your .env file contains all required variables
  • Verify that your bot token is valid
  • Make sure all dependencies are properly installed
  • Check if your cloud provider has any resource limitations

For additional help, join the ZygnalBot support server.

Choosing the Right Platform

Each cloud platform has its own advantages:

  • Railway: Simplest setup, good free tier, ideal for beginners
  • Google Cloud: Most generous free tier, highly reliable, good for scaling
  • Heroku: Easy to use, but requires paid plan now
  • Azure: Good integration with Microsoft services, free tier available

For most Discord bots, Railway or Google Cloud's free tiers will be sufficient.

Back to Home
Created by TheHolyOneZ