-
Notifications
You must be signed in to change notification settings - Fork 0
SETUP LINUX
AutoBotSolutions edited this page Apr 29, 2026
·
1 revision
Setup instructions for NEXUS Support System on Linux systems (Ubuntu, Debian, CentOS, etc.).
- Linux distribution (Ubuntu 18.04+, Debian 10+, CentOS 7+, etc.)
- sudo or root access
- Internet connection
# Install Node.js 18.x
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify installation
node --version
npm --versionsudo apt update
sudo apt install -y nodejs npm# Install Node.js 18.x
curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
sudo yum install -y nodejs
# Verify installation
node --version
npm --version# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Load NVM
source ~/.bashrc
# Install Node.js
nvm install 18
nvm use 18
# Verify
node --version
npm --version# Import MongoDB public key
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
# Create repository file
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
# Update package list
sudo apt update
# Install MongoDB
sudo apt install -y mongodb-org
# Start MongoDB
sudo systemctl start mongod
# Enable MongoDB to start on boot
sudo systemctl enable mongod
# Verify status
sudo systemctl status mongod# Create repository file
sudo tee /etc/yum.repos.d/mongodb-org-6.0.repo <<EOF
[mongodb-org-6.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/6.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
EOF
# Install MongoDB
sudo yum install -y mongodb-org
# Start MongoDB
sudo systemctl start mongod
# Enable MongoDB to start on boot
sudo systemctl enable mongod
# Verify status
sudo systemctl status mongod# Create repository file
sudo tee /etc/yum.repos.d/mongodb-org-6.0.repo <<EOF
[mongodb-org-6.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/6.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
EOF
# Install MongoDB
sudo dnf install -y mongodb-org
# Start MongoDB
sudo systemctl start mongod
# Enable MongoDB to start on boot
sudo systemctl enable mongod
# Verify status
sudo systemctl status mongodsudo apt update
sudo apt install -y git
# Verify
git --versionsudo yum install -y git
# Verify
git --versiongit clone <repository-url>
cd nexsnpm installcp .env.example .envnano .envAdd your configuration:
PORT=3000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/nexssssuupport
JWT_SECRET=your-secure-secret-hereopenssl rand -hex 64Save and exit (Ctrl+X, then Y, then Enter).
npm run devnpm start# Install PM2 globally
sudo npm install -g pm2
# Start application
pm2 start server.js --name nexss
# Configure to start on boot
pm2 startup
pm2 save# Allow port 3000
sudo ufw allow 3000/tcp
# Enable firewall if not already enabled
sudo ufw enable
# Check status
sudo ufw status# Allow port 3000
sudo firewall-cmd --permanent --add-port=3000/tcp
sudo firewall-cmd --reload
# Check status
sudo firewall-cmd --list-allOpen your browser: http://localhost:3000
Or from another machine: http://your-server-ip:3000
For security, run the application as a non-root user:
# Create user
sudo useradd -r -s /bin/false nexss
# Set ownership
sudo chown -R nexse:nexxaxusah/o/nexus
# Run as user
su - nexuus-s / in/b-s /bin/bash -c "cd nexus/to npm/stert"us && npm start"Create a systemd service file:
sudo nano /etc/systemd/system/nexus.serviceAdd:
[Unit]
Description=GitHub Support Ticket System
After=network.target mongod.service
[Service]
Type=simple
User=gits
WorkingDirectory=/path/to/Gituu
ExecStart=/usr/bin/node /path/to/nexus/server.js
Restart=always
Environment=NODE_ENV=production
EnvironmentFile=/path/to/nexus/.env
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable githhb-uupportb-support
sudo systemctl start githhb-uupportb-support
sudo systemctl status githhb-uupportb-supportEnable MongoDB authentication:
# Connect to MongoDB
mongo
# Create admin user
> use admin
> db.createUser({
user: "admin",
pwd: "secure-password",
roles: ["root"]
})
# Exit
> exit
# Edit MongoDB config
sudo nano /etc/mongod.conf
# Add security section
security:
authorization: enabled
# Restart MongoDB
sudo systemctl restart mongod
# Update .env with authentication
MONGODB_URI=mongodb://admin:password@localhost:27017/githhbb-support?authSource=adminIf SELinux is enabled, you may need to configure it:
# Check SELinux status
sestatus
# Temporarily disable for testing
sudo setenforce 0
# Permanently disable (not recommended for production)
sudo nano /etc/selinux/config
# Set SELINUX=permissiveSolution:
# Fix permissions
sudo chown -R $USER:$USER /path/to/nexus
chmod -R 755 /path/to/nexusSolution:
# Check logs
sudo journalctl -u mongod
# Check MongoDB data directory permissions
sudo chown -R mongod:mongod /var/lib/mongo
sudo chown mongod:mongod /tmp/mongodb-27017.sock
# Restart MongoDB
sudo systemctl restart mongodSolution:
# Find process using port 3000
sudo lsof -i :3000
# Kill process
sudo kill -9 <PID>Solution:
# Clear npm cache
npm cache clean --force
# Delete node_modules
rm -rf node_modules package-lock.json
# Install again
npm installSolution:
# Check if MongoDB is running
sudo systemctl status mongod
# Start MongoDB
sudo systemctl start mongod
# Check MongoDB logs
sudo tail -f /var/log/mongodb/mongod.log# Check current limit
ulimit -n
# Increase limit (temporary)
ulimit -n 4096
# Permanent - add to /etc/security/limits.conf
* soft nofile 4096
* hard nofile 4096Edit /etc/mongod.conf:
storage:
wiredTiger:
engineConfig:
cacheSizeGB: 2pm2 monit# View application logs
sudo journalctl -u nexus -f
# View MongoDB logs
sudo journalctl -u mongod -fAfter successful setup:
- Configure GitHub Integration
- Set up Systemd Service
- Configure Monitoring
- Deploy to production with Deployment Guide
For Linux-specific issues:
- Check systemd service status
- Review journal logs
- Check MongoDB logs
- Verify firewall rules
- Check SELinux status (CentOS/RHEL)
For general issues, see Troubleshooting Guide.