mgserver
v0.2.0
Published
CLI to automate nginx + letsencrypt setup on digital ocean
Downloads
15
Readme
MGServer Guide (digital ocean server init automation)
This is a guide for how to create a digital ocean instance with:
- Docker
- Letsencrypt
- Nginx (+ proxy_pass)
There are two "Getting Started" sections. One is a two liner, the other is more interactive.
Getting Started (Short Version)
# 1. Create a docker-machine
# 1.1 Setup DNS while this is being created (see below)...
docker-machine create --driver digitalocean --digitalocean-access-token $DIGITALOCEAN_ACCESS_TOKEN --digitalocean-monitoring=true --digitalocean-image=ubuntu-18-04-x64 --digitalocean-region=nyc3 <MACHINE_NAME>
# 2. Init server
mgserver init:remote <MACHINE_NAME>
Getting Started (Long Version)
# 1. Create a docker-machine
# 1.1 Setup DNS while this is being created (see below)...
docker-machine create --driver digitalocean --digitalocean-access-token $DIGITALOCEAN_ACCESS_TOKEN --digitalocean-monitoring=true --digitalocean-image=ubuntu-18-04-x64 --digitalocean-region=nyc3 <MACHINE_NAME>
# 2. ssh into the docker machine
docker-machine ssh <MACHINE_NAME>
# 3. Install nodejs v10
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && sudo apt-get install -y nodejs
# 4. Install mgserver
npm install -g mgserver
# 5. Run mgserver init & fill out the prompts...
mgserver init
Setting up DNS
- Go to https://cloud.digitalocean.com/networking/domains
- Add app url.
- Add
@
as anA record
to redirect to droplet. - Add
www
as anA record
to redirect to droplet.
Google Domains
Source: https://www.digitalocean.com/community/tutorials/how-to-point-to-digitalocean-nameservers-from-common-domain-registrars#registrar-google-domains-beta
- Sign in to your Google Domains account.
- Select the domain name that you want to use with your Droplet.
- At the top of the screen, click on the icon that represents Configure DNS.
- Click on Use custom name servers
- Enter the following nameservers:
- ns1.digitalocean.com
- ns2.digitalocean.com
- ns3.digitalocean.com
- Select Save to apply your changes. Now you are ready to move on to connecting the domain with your Droplet in the DigitalOcean control panel. Check out the Conclusion section below to read about what to do next.