Maintaining Ubuntu Droplet
by John Vincent
Posted on May 12, 2018
This is part of a series of discussions regarding Deploying to a Digital Ocean Droplet.
For more details, please see Deploy TaskMuncher
Maintaining Ubuntu Droplet
Update Npm
sudo npm install -g npm
Update Ubuntu
sudo apt-get update
did not retrieve any updates, just gets package information.
sudo apt-get dist-upgrade
older dist:
sudo apt-get upgrade
continue?
Y
A new version of /boot/grub/menu.lst is available, but the version installed currently has been locally modified.
Keep the local version currently installed.
Then restart the droplet
Restart the droplet
sudo reboot
Shutdown / Restart Droplet
Login to digitalocean.com
Select droplet
Console:
login as root
shutdown -h now
This will shut down your operating system, flush any pending changes to the disk, and then terminate power to your server.
Visit the control panel and select the option to power on your Droplet.
Verify droplet is not running
- Dashboard
- Access
- Launch Console
- Verify droplet is not running.
To start the droplet
- Dashboard
- Power
- Power cycle
Verify droplet is running
- Access
- Launch Console
- Login to verify droplet is running.
Renew SSL Certificates
See Update SSL Certificates to Ubuntu at Digital Ocean
Nginx
Restart Nginx
nginx-restart
or
sudo nginx -t
sudo systemctl restart nginx
Stop Nginx
sudo nginx -t
sudo systemctl stop nginx
Troubleshooting
Verify running
ps -ef | grep nginx
Check Nginx enabled servers
cd /etc/nginx/sites-enabled
ls -la
Enable https
enable-https
Enable http
enable-http
PM2
To restart PM2
pm2 restart all
To setup PM2 for the application
handle-pm2
Status
pm2 list
and then pm2 show {id}
, which provides details about the task. Notice the logs
PM2 Logs
Check the logs
/home/jv/.pm2/logs/*
/home/jv/.pm2/pm2.log
PM2 Other
pm2 monit
swap
sudo swapon --summary
free -h
Logs
Nginx logs /var/log/nginx
Check for bots
sudo vi /var/log/access.log
and
sudo vi /var/log/error.log
can sometimes have messages of some interest.
Firewall
May need to change the firewall
sudo ufw deny from XXX.XXX.XX.XX
List Rules
sudo ufw status numbered
Digital Ocean
- Building and deploying MyTunes to johnvincent.io
- Building and deploying React Github Helper App to johnvincent.io
- Configuring Google Domains
- Create Ubuntu Droplet at Digital Ocean
- Create Ubuntu Droplet at Digital Ocean
- Deploy Feediator to Digital Ocean
- Deploy to Droplet
- Feediator Overview
- Feediator Project
- Maintaining Ubuntu Droplet
- Maintaining Ubuntu Droplet
- Overview of Deployment of a Node API Server
- Overview of johnvincent.io
- Overview of johnvincent.io Jekyll website
- Overview of React Gomoku
- Overview of React Hangman
- Overview of React Lights Out
- Overview of React Yahtzee
- TaskMuncher Overview
Taskmuncher
- Backup TaskMuncher from Digital Ocean
- Configure HTTP Nginx
- Configure HTTPS Nginx
- Configuring Google Domains
- Configuring Meta Tags
- Create Site Map
- Create SSL Certificates
- Create Ubuntu Droplet at Digital Ocean
- Deploy TaskMuncher React App to AWS
- Facebook Application Id
- First time deploy TaskMuncher React App to Digital Ocean
- Google Analytics for TaskMuncher
- Google Authentication
- Google Gmail Configuration
- Google Webmaster Tools
- Install Ubuntu Mongo
- Install Ubuntu Nginx
- Mailgun
- Maintaining Ubuntu Droplet
- Material-UI Showcase
- Optimizing TaskMuncher with Webpack 4
- React Production Issues
- TaskMuncher Images and Favicons
- TaskMuncher Overview
- TaskMuncher Performance
- TaskMuncher Website Validation
- Update SSL Certificates
- Update TaskMuncher for Lighthouse Findings
- Update TaskMuncher to be a Progressive Web App
- Update TaskMuncher to use React BrowserRouter
- Update TaskMuncher to Webpack v4, Babel v7, Material-UI v3
Ubuntu
- Configure HTTP Nginx
- Configure HTTP Nginx
- Configure HTTPS Nginx
- Configure HTTPS Nginx
- Configure PM2
- Create SSL Certificates
- Create SSL Certificates
- Create Ubuntu Droplet at Digital Ocean
- Create Ubuntu Droplet at Digital Ocean
- Deploy Feediator to Digital Ocean
- Install Jekyll Ubuntu
- Install Ubuntu Mongo
- Install Ubuntu Nginx
- Install Ubuntu Nginx
- Maintaining Ubuntu Droplet
- Maintaining Ubuntu Droplet
- SSH to Github
- Update SSL Certificates
- Update SSL Certificates