Sign inSign up

alokdekadev/linux-server-monitoring

By alokdekadev

•Updated 9 months ago

Monitor Linux servers with beautiful dashboard! Real-time metrics, smart alerts. Deploy in 2 mins.

Image
Developer tools
Monitoring & observability
0

239

alokdekadev/linux-server-monitoring repository overview

ā šŸ–„ļø Linux Server Health Monitoring System

Deploy using pre-built Docker Hub images - no building required, just pull and run!

Monitor all your Linux servers from one beautiful dashboard. A complete, easy-to-use monitoring solution that watches your servers 24/7 and alerts you when something goes wrong.

ā šŸš€ Quick Start (2 Minutes!)

# Create docker-compose.yml file
cat > docker-compose.yml << 'EOF'
services:
  postgres:
    image: postgres:15-alpine
    container_name: monitoring_postgres
    environment:
      POSTGRES_DB: ${POSTGRES_DB:-monitoring}
      POSTGRES_USER: ${POSTGRES_USER:-monitoring_user}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-monitoring_pass}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "${POSTGRES_PORT:-5432}:5432"
    networks:
      - monitoring_network
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-monitoring_user} -d ${POSTGRES_DB:-monitoring}"]
      interval: 10s
      timeout: 5s
      retries: 5

  server:
    image: alokdekadev/linux-server-monitoring:server
    container_name: monitoring_server
    environment:
      DATABASE_URL: postgresql://${POSTGRES_USER:-monitoring_user}:${POSTGRES_PASSWORD:-monitoring_pass}@postgres:5432/${POSTGRES_DB:-monitoring}
      HOST: ${SERVER_HOST:-0.0.0.0}
      PORT: ${SERVER_PORT:-8000}
      LOG_LEVEL: ${LOG_LEVEL:-info}
    ports:
      - "${SERVER_PORT:-8000}:8000"
    depends_on:
      postgres:
        condition: service_healthy
    networks:
      - monitoring_network
    restart: unless-stopped

  dashboard:
    image: alokdekadev/linux-server-monitoring:dashboard
    container_name: monitoring_dashboard
    environment:
      VITE_API_BASE_URL: ${DASHBOARD_API_URL:-http://localhost:8000}
      VITE_WS_BASE_URL: ${DASHBOARD_WS_URL:-ws://localhost:8000}
    ports:
      - "${DASHBOARD_PORT:-3000}:3000"
    depends_on:
      - server
    networks:
      - monitoring_network
    restart: unless-stopped

volumes:
  postgres_data:
    driver: local

networks:
  monitoring_network:
    driver: bridge
EOF

# Create environment file
cat > .env << 'EOF'
POSTGRES_PASSWORD=your_secure_password_here
DASHBOARD_API_URL=http://localhost:8000
DASHBOARD_WS_URL=ws://localhost:8000
EOF

# Start all services
docker compose up -d

# Create admin user
docker compose exec server python server/cli/create_admin.py

Access Points:

ā šŸ“¦ Available Images

This repository contains two components with different tags:

ComponentTagDescriptionSizePlatforms
ServerserverFastAPI backend with monitoring engine~200MBAMD64, ARM64
DashboarddashboardReact web interface~300MBAMD64, ARM64
# Pull individual components
docker pull alokdekadev/linux-server-monitoring:server
docker pull alokdekadev/linux-server-monitoring:dashboard

⁠✨ Key Features

  • šŸ”„ Real-time Monitoring - Live metrics updated every 30 seconds
  • šŸ“Š Beautiful Dashboard - Modern React-based web interface
  • 🚨 Smart Alerts - Configurable thresholds with Slack/email notifications
  • šŸ”’ Secure - JWT authentication with role-based access
  • šŸ“± Mobile Friendly - Responsive design works on all devices
  • šŸ”§ Lightweight Agents - Minimal resource usage (50MB RAM)
  • šŸ“ˆ Historical Data - Track trends and performance over time

ā šŸ”§ Configuration

⁠Environment Variables
# Database Configuration
POSTGRES_PASSWORD=secure_password

# Server Configuration
SERVER_PORT=8000
LOG_LEVEL=info

# Dashboard Configuration
DASHBOARD_PORT=3000
DASHBOARD_API_URL=http://localhost:8000
DASHBOARD_WS_URL=ws://localhost:8000

# Alert Configuration
ALERT_CPU_THRESHOLD=90.0
ALERT_DISK_THRESHOLD=80.0
ALERT_OFFLINE_TIMEOUT=300

# Webhook Configuration (optional)
WEBHOOK_URLS=https://hooks.slack.com/your-webhook
⁠Custom Ports
# Use different ports
DASHBOARD_PORT=8080
SERVER_PORT=9000

⁠🌐 Remote Server Deployment

# SSH into your server
ssh user@your-server-ip

# Create deployment directory
mkdir -p ~/monitoring-system && cd ~/monitoring-system

# Create docker-compose.yml (use the configuration from Quick Start above)

# Create environment for remote access
cat > .env << EOF
POSTGRES_PASSWORD=your_secure_password
DASHBOARD_API_URL=http://your-server-ip:8000
DASHBOARD_WS_URL=ws://your-server-ip:8000
EOF

# Deploy
docker compose up -d
docker compose exec server python server/cli/create_admin.py

ā šŸ“” Adding Servers to Monitor

  1. Register in Dashboard: Go to "Server Management" → "Register New Server"
  2. Install Agent: Use the generated installation command:
    curl -sSL http://your-server:8000/install-agent.sh | bash -s -- \
      --api-key="your-api-key" --server-url="http://your-server:8000"
    

ā šŸ”’ Production Security

⁠SSL/TLS with Reverse Proxy
server {
    listen 443 ssl;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:3000;
    }

    location /api/ {
        proxy_pass http://localhost:8000;
    }

    location /ws {
        proxy_pass http://localhost:8000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

ā šŸ“Š Monitoring Capabilities

⁠System Metrics
  • CPU Usage, Memory Usage, Disk Usage
  • Load Average, Uptime, Network Statistics
⁠Service Monitoring
  • Systemd Services, Process Monitoring
  • Service Dependencies
⁠Alerting
  • Threshold-based Alerts, Service Failure Alerts
  • Server Offline Alerts, Custom Webhooks

ā šŸ› ļø Maintenance

# Update to latest images
docker compose pull && docker compose up -d

# View logs
docker compose logs -f server
docker compose logs -f dashboard

# Backup database
docker compose exec postgres pg_dump -U monitoring_user monitoring > backup.sql

# Health check
curl -f http://localhost:8000/api/v1/health

ā šŸŽÆ Advantages

āœ… No Build Time - Pre-built and optimized images āœ… Faster Deployment - Just pull and run
āœ… Multi-Architecture - Works on AMD64 and ARM64 āœ… Production Ready - Tested and secure āœ… Easy Scaling - Standard Docker patterns

ā šŸ“š Documentation & Support

ā šŸ·ļø Tags

  • server, latest-server - Latest server component
  • dashboard, latest-dashboard - Latest dashboard component
  • v1.0.0-server, v1.0.0-dashboard - Version releases

Ready to monitor your servers? šŸš€

# One-liner deployment (copy the docker-compose.yml from above first)
echo "POSTGRES_PASSWORD=secure_password" > .env && docker compose up -d

Made with ā¤ļø by Alok Deka⁠

Tag summary

Content type

Image

Digest

sha256:fe9f45a14…

Size

119.3 MB

Last updated

9 months ago

docker pull alokdekadev/linux-server-monitoring:latest-dashboard