Spin up a new Ubuntu, Nginx, MariaDB, PHP server on Digital Ocean
- Placeholder values are delimited with
- Clone this repo
git clone https://github.com/thegreatsunra/lemp-cloud-init.git
- Generate an SSH key if you don't have one already
ssh-keygen -t rsa -b 4096 -C "email@example.com"
- Copy your SSH key to your clipboard
pbcopy < ~/.ssh/id_rsa.pub
./scripts/cloud-init.sh.txtin a text editor and replace the placeholder SSH key (around line 30) with the contents of your clipboard
- ssh-rsa AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== firstname.lastname@example.org__
Be careful not to delete the indentation or
- at the beginning of the line, as
cloud-init needs them to recognize the command
- Search within
./scripts/cloud-init.sh.txtand replace the following placeholder strings with your desired values:
__username__- the username of the primary admin user that will be created on the server (e.g.
__full_name__- the full name of the primary admin user (e.g.
email@example.com__- the email address of the primary admin user
__domain.tld__- the domain for your website that will be hosted by nginx (e.g.
__temporary_password_change_me_immediately__- a temporary, throwaway password that will live forever on your server in your
cloud-initscript and you will immediately change upon logging into the server
./scripts/cloud-init.sh.txt, select all, and copy it to your clipboard
Log in to Digital Ocean
Create a new droplet
Under "Select additional options" check the box for "User data" and paste in the contents of
Click "Create" and wait a few moments as Digital Ocean creats your new droplet
Once Digital Ocean finishes creating your droplet, copy the IP address for your droplet
Prepare manual commands
./scripts/manual-commands.sh.txtin a text editor
Perform a search-and-replace on
./scripts/manual-commands.sh.txt, and replace the following values with the values you used in your
cloud-initscript, and the values provided by Digital Ocean when creating your droplet
__REPLACE_THIS_TEXT_WITH_YOUR_ACTUAL_SERVER_IP__- the IP address Digital Ocean assigned to your server
__REPLACE_THIS_TEXT_WITH_YOUR_ACTUAL_USERNAME__- the username of the primary admin user that you created on the server (e.g.
__REPLACE_THIS_TEXT_WITH_YOUR_ACTUAL_EMAIL__- the email address of the primary admin user
__REPLACE_THIS_TEXT_WITH_YOUR_ACTUAL_DOMAIN__- the domain for the website that you will host on your server (e.g.
__REPLACE_THIS_TEXT_WITH_YOUR_ACTUAL_SERVER_DOMAIN_NAME__- the domain you want to assign to your server (e.g.
- SSH into your new server using the username you chose and the IP address provided by Digital Ocean
- Go line-by-line through
./scripts/manual-commands.sh.txt, pasting each command into the Terminal to run it on your server like some kind of animal
The MIT License (MIT)
Copyright (c) 2017-2019 Dane Petersen