Keep your Discord account's online status (green icon) active 24/7, regardless of whether you're using the desktop or mobile app.
- ** Error Notifications** - Optional Discord webhook notifications for errors
- ** Dual Mode** - Supports both external cron (default) and internal scheduling modes
# Clone the repository
git clone https://github.com/zbcoding/discord_always_online.git
cd discord_always_online
# Copy and configure environment variables
cp .env.example .env
# Edit .env with your Discord token
# Run with Docker Compose
docker-compose up -d
# Check status
curl http://localhost:3000# Clone the repository
git clone https://github.com/zbcoding/discord_always_online.git
cd discord_always_online
# Install dependencies
npm install
# Copy and configure environment variables
cp .env.example .env
# Edit .env with your Discord token
# Start the application
npm startCreate a .env file in the project root:
# Discord Account Token (REQUIRED)
TOKEN=your_discord_token_here
# Discord Webhook URLs for error notifications (OPTIONAL)
WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook_url
WEBHOOK_URL_LOW=https://discord.com/api/webhooks/your_low_priority_webhook_url
# Server Configuration
PORT=3000
# Scheduling Mode
# By default, uses external cron mode (requires external service to ping the endpoint)
# Set to 'true' to enable internal scheduling (no external service needed)
# USE_INTERNAL_SCHEDULING=true| Variable | Required | Default | Description |
|---|---|---|---|
TOKEN |
✅ Yes | - | Your Discord user token |
WEBHOOK_URL |
❌ No | - | Discord webhook for high-priority error notifications |
WEBHOOK_URL_LOW |
❌ No | - | Discord webhook for low-priority error notifications |
PORT |
❌ No | 3000 |
Port for the health check server |
USE_INTERNAL_SCHEDULING |
❌ No | false |
Enable internal scheduling mode (no external cron needed) |
⚠️ Warning: Your Discord token is like a password. Never share it or commit it to version control!
- Open Discord in your web browser
- Press
F12to open Developer Tools - Go to the Application tab
- In the left sidebar, expand Local Storage →
https://discord.com - Search for
tokenin the filter box - Copy the value (it usually starts with
Mfa.or similar)
Alternatively:
- Go to the Network tab
- Filter by
/api - Look for the
Authorizationheader in any request - Copy the token value
Visit http://localhost:3000/ to see:
- Account status
- Current mode (Internal Scheduling / External Cron)
- Uptime
- Last reconnection time
Example response:
Discord Always Online - Health Check
Accounts (1):
1. YourUsername
Last: 2025-01-15T10:30:00.000Z
Status: Running
Mode: Internal Scheduling
Uptime: 42 minutes
Current Time: 2025-01-15T10:35:00.000Z
- Requires external cron service (UptimeRobot, cron-job.org, etc.)
- External service pings
http://your-server:3000/every 5-10 minutes to trigger reconnections - Recommended for platforms like Render, Railway, or Heroku free tiers that auto-sleep
- Setup: Configure an external service to ping your endpoint regularly
- Set
USE_INTERNAL_SCHEDULING=truein.env - No external services needed
- Reconnects every 3-5 minutes automatically with random intervals
- Best for VPS, dedicated servers, or Docker deployments
- Just run
npm startand forget!
- Push your code to a Git repository
- Create a new service in Coolify pointing to your repo
- Add environment variables in Coolify dashboard:
TOKEN=your_tokenUSE_INTERNAL_SCHEDULING=true(recommended for VPS)
- Deploy!
- Connect your GitHub repository
- Add environment variables in the dashboard:
TOKEN=your_token- Option A (External Cron - Default): Set up UptimeRobot or similar to ping your app URL every 5-10 minutes
- Option B (Internal Scheduling): Add
USE_INTERNAL_SCHEDULING=true
- Deploy as a web service
- The app will start automatically
Note: For free tiers that auto-sleep, external cron (Option A) is recommended to wake the service.
# Clone on your server
git clone https://github.com/zbcoding/discord_always_online.git
cd discord_always_online
# Install dependencies
npm install
# Configure environment
cp .env.example .env
nano .env # Add your token and set USE_INTERNAL_SCHEDULING=true
# Run with PM2 (recommended for production)
npm install -g pm2
pm2 start index.js --name discord-always-online
pm2 save
pm2 startup- Your Discord token has expired or is incorrect
- You may have changed your Discord password (requires a new token)
- Copy a fresh token from Discord using the steps above
- Discord might be rate-limiting you
- Check if you have a stable internet connection
- Review logs for specific error messages
- The bot hasn't connected yet (wait 30 seconds)
- Invalid token preventing connection
- Check console logs for errors
- Verify your
WEBHOOK_URLis correct - Test the webhook manually with a curl command
- Check that the webhook channel still exists
# Install dependencies
npm install
# Run in development mode
npm run dev
# The app will start and show logs in the console