3.7 KiB
3.7 KiB
InInventer Deployment Guide
This guide will walk you through deploying InInventer to a Debian 12 server on Linode.
Prerequisites
- A Linode server running Debian 12
- A domain name pointing to your server's IP address
- Root access to the server
- Basic knowledge of Linux command line
Step 1: Prepare Your Local Environment
- Make scripts executable:
chmod +x deploy.sh start-production.sh backup.sh
- Create a deployment package:
tar -czf ininventer-deploy.tar.gz \
--exclude='node_modules' \
--exclude='.git' \
--exclude='*.log' \
--exclude='.env' \
backend/ frontend/ nginx/ \
docker-compose.yml deploy.sh \
start-production.sh backup.sh
Step 2: Upload Files to Server
- Copy the deployment package to your server:
scp ininventer-deploy.tar.gz root@172.104.242.160:/tmp/
- Copy the deployment script:
scp deploy.sh root@172.104.242.160:/tmp/
Step 3: Connect to Server and Deploy
- SSH into your server:
ssh root@172.104.242.160
- Run the deployment script:
cd /tmp
chmod +x deploy.sh
./deploy.sh
- When prompted, enter:
- Your domain name (e.g., inventory.yourdomain.com)
- Email address for SSL certificates
Step 4: Extract Application Files
After the deployment script completes:
cd /opt/ininventer
tar -xzf /tmp/ininventer-deploy.tar.gz
chmod +x start-production.sh backup.sh
Step 5: Start the Application
Run the production start script:
./start-production.sh
This script will:
- Obtain SSL certificates from Let's Encrypt
- Start all Docker containers
- Configure automatic SSL renewal
- Set up systemd service for auto-start
Step 6: Verify Deployment
- Check if all containers are running:
docker-compose -f docker-compose.production.yml ps
- Check logs:
docker-compose -f docker-compose.production.yml logs -f
- Visit your domain in a web browser:
Step 7: First Login
Default credentials:
- Email:
admin@ininventer.com
- Password:
admin123
IMPORTANT: Change the default password immediately after first login!
Maintenance
View Logs
cd /opt/ininventer
docker-compose -f docker-compose.production.yml logs -f [service_name]
Restart Services
systemctl restart ininventer
Manual Backup
cd /opt/ininventer
./backup.sh
Update Application
cd /opt/ininventer
docker-compose -f docker-compose.production.yml down
# Upload new files
docker-compose -f docker-compose.production.yml build
docker-compose -f docker-compose.production.yml up -d
Security Recommendations
-
Change Default Passwords
- Change the superadmin password immediately
- Update MongoDB passwords in production
-
Firewall Configuration
- Only ports 22, 80, and 443 should be open
- Consider changing SSH port
-
Regular Backups
- Set up automated backups using cron:
crontab -e # Add: 0 2 * * * /opt/ininventer/backup.sh
-
Monitor Resources
- Check disk space regularly
- Monitor CPU and memory usage
Troubleshooting
SSL Certificate Issues
# Renew certificates manually
docker-compose -f docker-compose.production.yml run --rm certbot renew
Container Won't Start
# Check logs
docker-compose -f docker-compose.production.yml logs [service_name]
# Rebuild containers
docker-compose -f docker-compose.production.yml build --no-cache
Database Connection Issues
# Check MongoDB is running
docker exec -it ininventer-mongodb-prod mongo --eval "db.adminCommand('ping')"
Support
For issues or questions:
- Check container logs
- Verify domain DNS settings
- Ensure firewall rules are correct
- Check disk space and resources