Digital Ocean
Use this link to register Digital Ocean with $10 credit.
Droplet Setup (Ubuntu) for Node.js App (Meteor etc)
Follow mup guide:
Add Public Key to New Remote User, by follow https://gist.github.com/jamiewilson/4e1d28f9a200cb34ad59#set-up-ssl
disable root access, change port(using the same guide by editing '/etc/ssh/sshd_config')
Don't need to add swap when using SSD
Use unattended-upgrades to only do security updates (Otherwise when you do
apt-get upgrade
it'll update your version to Non-LTS version!)
Optional:
change editor to use vi sudo update-alternatives --config editor
References:
If you want nginx support:
mup doc (which automatically use nginx, you don't need to setup anything)
More security setup from this linux workstation checklist:
MongoDB
automatic backup
crontab:
How to manually backup or restore
Oplog
How to enable oplog if the db is already in use?
ref:
(outdated: it's using mongodb 2.4) https://gentlenode.com/journal/meteor-10-set-up-oplog-tailing-on-ubuntu/17
SSL
How to check?
Online tool: https://www.sslshopper.com/ssl-checker.html
Or use ssl-cert-check
on server (reference):
(LATEST 2021) With Mup you don't need to do manual setup SSL anymore
Setup SSL using mupx and Let’s Encrypt
Steps
Make sure A record is already updated for your domain first
SSH to server:
The following 4 files will be generated in the archive folder: /etc/letsencrypt/archive/YOURDOMAIN.COM
(Note the ones in /etc/letsencrypt/live/YOURDOMAIN.COM
is symlinked to archive folder)
cert1.pem
chain1.pem
fullchain1.pem
privkey1.pem
Now we want to copy those files to your local machine:
Put the downloaded two files (fullchain.pem and privkey.pem) in your local folder where mup can access (see mup.json)
Update mup.json
Don't forget to add force-ssl
package: meteor add force-ssl
Renew automatically
NOTE this will NOT work because the server has to be stopped
Let’s Encrypt expires 90 days, so we create cron job to automatically update:
To renew manually
Key points:
You need to stop server before running renew.
if cert is expired, you need to run
mpux setup
againif you run letsencrypt renew, new files will be generated (such as cert2.pem)
cert.pem: Your domain's certificate
chain.pem: The Let's Encrypt chain certificate
fullchain.pem: cert.pem and chain.pem combined
privkey.pem: Your certificate's private key
Reference:
Additional:
Last updated