On this article we're gonna follow some very simple & basic instructions on how to deploy three different websites on DigitalOcean.  We are going to use Ubuntu, which is a Linux distribution (distro for short), and Nginx which is a web server that a lot of web developers love to use instead of the older and more resource consuming Apache Web Server.

Command Name

What does it do

ssh-keygen -t rsa Starts the process of generating a new pair of SSH Keys. Yeiii!
ssh-keygen -t rsa -C "This email address is being protected from spambots. You need JavaScript enabled to view it." Generates a new pair of SSH Keys with your e-mail attached to the SSH Key.
ssh-keygen -t rsa -f ~/.ssh/yourSSHKEYNAME_rsa Generates an RSA SSH Key with a custom name
ssh-keygen -t rsa -b 4096 -C "This email address is being protected from spambots. You need JavaScript enabled to view it." Generates a 4096 bits SSH pair of keys
ssh-keygen -t rsa -b 4096 -C "This email address is being protected from spambots. You need JavaScript enabled to view it.-f ~/.ssh/YourSSHCostumeName_rsa Generates a 4096 bits SSH pair of keys with a costum email and a costume name within the .ssh folder
eval ssh-agent starts an agent on your machine so you can assign to it (him) a pair of SSH keys.
ssh-add ~/.ssh/id_rsa adds your id_rsa key within your .ssh folder to the agent

pbcopy < ~/.ssh/id_rsa.pub

Copies the file id_rsa.pub (change the id_rsa.pub filename if you want to copy other files)
 ls -al ~/.ssh Gives you a list of all your SSH keys that has been generated on your default SSH key folder
cp /var/www/index.html /var/www/index2.html copies the file index.html to a new file called index2.html on the same folder
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ creates a symbolic link of the file example.com to different folder (the sites enabled folder)
mv oldfilename newfilename Renames a file
cat ~/.ssh/yourfilename_rsa.pub  Shows the actual content of your public SSH key
sudo ufw show added Check the ports added to your server. 
sudo ufw enable enables the firewall (blocks all ports, except the ones that are added to your server)
rmdir -rf YourFolderName Deletes A folder with all it's contents
sudo chown -R $USER:$USER /var/www/YourFolderName  Grants permissions to user for creating and editing files within YourFolderName

Homebrew is one of the so called packages managers that a lot of web developers use. If you install Homebrew on you MAC you can use it for example to install Node.js on your computer. Although you can install Node.js without Homebrew, some developers think that using Homebrew to install software packages such as Node.js on their mac is best, because the packages are installed using the same commands and directories, thus, letting Homebrew to manage all the packages updates, and deletion. You can also install the MySQL Database Server using Homebrew. 

Within MAC, Linux and Windows we usually use the native GUIs (that is graphical user interfaces), to move around and fiddle with things (files, folders and applications), this means that we can use a mouse and simply point, click & drag, and get a lot of work done very intuitively, without having to read much instructions or documentation.

Subcategories