How do I fix out of disk space on EC2?
Check disk usage with df -h. Find large files with sudo du -sh /* | sort -rh. Clear PM2 logs (pm2 flush), truncate Nginx logs, and run sudo apt clean. If the issue persists, increase the EBS volume size in AWS Console.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in EC2 Troubleshooting and Common Issues Fixing Node.js Deployment Problems
Check if the Node.js app is running with pm2 status. If not, start it. Check PM2 logs for errors (pm2 logs --err). Verify Nginx proxy_pass matches the app port. Ensure port 3000 is listening. Restart both PM2 and Nginx.
Check if the instance is running in AWS Console. Ensure the security group allows SSH (port 22) from your current IP. Verify key file permissions (chmod 400). Use the correct username (ubuntu for Ubuntu AMIs). Run ssh -v for verbose debugging.
Check error logs with pm2 logs --err --lines 50. Common causes: missing .env file, MongoDB connection failed, port already in use, or missing dependencies. Fix the underlying error, then run pm2 flush to clear logs and pm2 restart.
Still have questions?
Browse all our FAQs or reach out to our support team
