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 protected]"- Copy your SSH key to your clipboard
pbcopy < ~/.ssh/id_rsa.pub- Open
./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== [email protected]__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.dane)__full_name__- the full name of the primary admin user (e.g.Dane Petersen)[email protected]__- 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-initscript 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.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 yourcloud-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.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
- 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