Linux Dash Deployment and Usage Guide
Prerequisites
System Requirements
- Linux-based operating system (Ubuntu, Debian, CentOS, etc.)
- Node.js v10+ (recommended), Go v1.16+, Python 3.6+, or PHP 7.4+ (depending on your chosen server)
Tools
- Git for cloning the repository
- Package manager for your chosen language (npm, go, pip, composer)
Installation
Step 1: Clone the Repository
# Clone the repository
git clone --depth 1 https://github.com/afaqurk/linux-dash.git
# Navigate to the server directory
cd linux-dash/app/server
Step 2: Choose Your Server Stack
Linux Dash supports multiple server implementations. Choose one based on your preference:
Node.js (Recommended)
# Install dependencies
npm install --production
# Start the server (default port 80)
node index.js
# Optional: Specify custom port and host
LINUX_DASH_SERVER_PORT=8080 LINUX_DASH_SERVER_HOST=127.0.0.1 node index.js
Go
# Start the server (default port 80)
go run index.go
# Build binary for production
go build && ./server -h
Python
# Start the server (default port 80)
python index.py
PHP
- Ensure
exec,shell_exec, andescapeshellargfunctions are enabled in your PHP configuration - Point your web server (Apache, nginx) to the
app/directory - Restart your web server
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
LINUX_DASH_SERVER_PORT | Port for the server to listen on | 80 |
LINUX_DASH_SERVER_HOST | Host/IP for the server to bind to | 0.0.0.0 (all interfaces) |
Security Considerations
Important: Linux Dash does not include authentication or security features. You must implement your own security measures:
- Use reverse proxy with authentication (nginx, Apache)
- Restrict access via firewall rules
- Use HTTPS with valid certificates
- Consider VPN access for internal networks
Build & Run
Development Mode
For Node.js:
# Install dependencies with dev dependencies
npm install
# Start in development mode (with hot reload if available)
node index.js
Production Mode
Node.js
# Install only production dependencies
npm install --production
# Start with process manager (recommended)
pm2 start index.js --name linux-dash
# Or use systemd service
sudo cp linux-dash.service /etc/systemd/system/
sudo systemctl enable linux-dash
sudo systemctl start linux-dash
Go
# Build optimized binary
go build -o linux-dash-server
# Run as service
./linux-dash-server
Python
# Install dependencies
pip install -r requirements.txt
# Run with gunicorn for production
gunicorn -w 4 -b 0.0.0.0:80 index:app
Deployment
Platform Recommendations
Cloud Platforms
- VPS/Dedicated Server: DigitalOcean, Linode, Vultr (full control)
- Platform as a Service: Heroku (Node.js/Go), Railway (multi-language)
Container Deployment
# Build Docker image
docker build -t linux-dash .
# Run container
docker run -d -p 80:80 linux-dash
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: linux-dash
spec:
replicas: 1
selector:
matchLabels:
app: linux-dash
template:
metadata:
labels:
app: linux-dash
spec:
containers:
- name: linux-dash
image: linux-dash:latest
ports:
- containerPort: 80
Reverse Proxy Configuration (Recommended)
Nginx
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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;
proxy_cache_bypass $http_upgrade;
}
}
Troubleshooting
Common Issues
Port 80 Access Denied
# Solution: Use sudo or change port
sudo node index.js
# Or use port 3000 (requires less privileges)
LINUX_DASH_SERVER_PORT=3000 node index.js
Permission Denied for System Commands
Ensure the web server user has appropriate permissions to execute system commands. Add to sudoers if necessary:
# Add to sudoers (use with caution)
www-data ALL=(ALL) NOPASSWD: /usr/bin/free, /usr/bin/df, /usr/bin/who
WebSocket Connection Issues
# Check if WebSocket is supported
# In browser console:
if (window.WebSocket) console.log("WebSocket supported");
else console.log("WebSocket not supported");
Module Data Not Loading
# Check server logs
node index.js
# Verify system commands are executable
which free
which df
which who
High Resource Usage
# Monitor resource usage
top -p $(pgrep -f linux-dash)
# Adjust refresh rate in the dashboard
# Or limit concurrent requests in your server configuration
Debug Mode
Enable debug logging by setting:
DEBUG=linux-dash node index.js
Performance Optimization
- Use reverse proxy with caching
- Enable gzip compression
- Limit refresh rates for data-intensive modules
- Consider using WebSockets for real-time updates
Security Hardening
- Implement IP whitelisting
- Use strong authentication (OAuth, JWT)
- Regular security audits of executed commands
- Keep dependencies updated
- Monitor logs for suspicious activity