Spin up a new Ubuntu, Nginx, MariaDB, PHP server on Digital Ocean
- Placeholder values are delimited with
__double_underscores__
- 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@domain.tld"
- Copy your SSH key to your clipboard
pbcopy < ~/.ssh/id_rsa.pub
- Open
./scripts/cloud-init.sh.txt
in a text editor and replace the placeholder SSH key (around line 30) with the contents of your clipboard
- ssh-rsa AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== __email@domain.tld__
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.txt
and 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.dane
)__full_name__
- the full name of the primary admin user (e.g.Dane Petersen
)__email@domain.tld__
- the email address of the primary admin user__domain.tld__
- the domain for your website that will be hosted by nginx (e.g.thegreatsunra.com
)__temporary_password_change_me_immediately__
- a temporary, throwaway password that will live forever on your server in yourcloud-init
script and you will immediately change upon logging into the server
- Save
./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
./scripts/cloud-init.sh.txt
-
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
-
Open
./scripts/manual-commands.sh.txt
in 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 yourcloud-init
script, 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.dane
)__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.thegreatsunra.com
)__REPLACE_THIS_TEXT_WITH_YOUR_ACTUAL_SERVER_DOMAIN_NAME__
- the domain you want to assign to your server (e.g.swearengen.thegreatsunra.com
)
- Save
./scripts/manual-commands.sh.txt
- SSH into your new server using the username you chose and the IP address provided by Digital Ocean
ssh username@ip.address.of.server
- 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