A Note For Beginners
Setting up a cloud server is a pretty deep topic, but following the steps and getting started in DigitalOcean is pretty straight forward. If you are a beginner, keep at it and don’t be afraid to keep following the links provided in subsequent articles until you find all of the information you need. It might take a couple of days to dig through DigitalOcean’s and really understand everything needed just to get to a command prompt – that is normal. Keep at it, but If it seems the information you need to get up and running is not available through the linked articles on this blog, Please e-mail us.
Setting Up Your Droplet
Setting up a cloud server is a pretty deep topic, but following the steps and getting started in DigitalOcean is pretty straight forward. If you are a beginner, keep at it and don’t be afraid to keep following the links provided in subsequent articles until you find all of the information you need. It might take a couple of days to dig through DigitalOcean’s and really understand everything needed just to get to a command prompt – that is normal. Keep at it, but If it seems the information you need to get up and running is not available through the linked articles on this blog, Please e-mail us.
It is recommended to set up your SSH keys during the initial droplet setup. See the SSH Keys section if you are unfamiliar with configuring SSH keys.
Your server name will be part of your future command line. The name of your droplet should be simple and informative. The format Projectname-0-0 is favorable. The extra zeros and dashes are placeholders for future droplet version changes. The next versioned droplet would be 0-1 for example.
At minimum is best to:
- Add SSH Keys
- Add a sudo user
- Remove password access for root user
By far the easiest way to get is save your SSH keys into Digital Ocean, and by using the DigitalOcean’s Automated Bash Script during your initial droplet configuration. SSH Keys are the hardest part, but once they are set up, you will be able to run just this one line from your local machine’s terminal to connect to your remote server.
The username is the username you set up in the automated script above. The hostname is the Public IP address of your droplet.
$ ssh username@hostname
SSH Keys
If you do not have your SSH keys saved in DigitalOcean’s web interface, it is recommended that you do so. It is much easier than setting them up yourself through the terminal.
The first time you start working with a cloud server from your home computer’s terminal interface, you will need to generate an SSH key that lives on your home computer. Basically an SSH key is a humongous password that sits on your home computer, within your file system. You generate SSH keys like this:
ssh-keygen
There is much more to SSH, of course. Refer to the guides below to get your Droplet set up with SSH keys.
More About SSH
There are a few common things that trip up new SSH users. These tips should help you find your SSH keys on your local machine and copy the SSH key to Digital Ocean.
On a Mac, the default location of your SSH keys is: /Users/your_user_name/.ssh/id_rsa.pub
If you are not a wiz at the command line interface (CLI) yet, can find navigate to the id_rsa.pub file using the Finder. You will also need to make sure you make your hidden files viewable. The .ssh folder (and many more folders and files) are default to hidden on a stock Mac machine.
Also, to copy and paste the entire SSH key, you will need a more powerful text editor, such as The Atom Text Editor. The default TextEdit program on a Mac has a hard time with SSH keys because SSH keys are such a long string of text -The TextEdit program will actually add extra characters! This obviously won’t do when working with SSH keys – and it is a common source of frustration. Atom can open it just fine.
The DigitalOcean guide is a bit confusing about the SSH key format. Just go ahead and copy the text and everything else that is in the id_rsa.pub file. If your text editor is adding extra characters, you will be extra confused.