This guide is continuously being updated, as reality demands updates. If you find any errors in this guide, please let us know.
This will guide you through installing the parentNode web stack on a clean Ubuntu 18.04 server. The full stack includes Apache 2.4, PHP 7.2, MariaDB 10.2, Imagick, Redis cache, FFmpeg for JIT video and audio conversion and wkhtmltopdf for PDF generation.
The majority of the install process will be handled by an install script, which will also take care of securing your new server. But there are a few steps to take before we get to that.
Create your new server
Go to the control panel of you preferred Hosting provider.
Consider Kualo, a 100% green powered hosting provider in the UK. In my opinion the best option, if you're located in Europe and only need a single server. I also use Rackspace for more complex setups – they not green, but unfortunately there are only worse options to choose from in this category and thus the not so good option becomes the best option.
I'm currently using Ubuntu 18.04 LTS and in most cases a 1GB General Purpose server is more than enough to run 20 smaller websites.
When you create your new server, you will be provided with the new (temporary) root password. This is important, as you'll need it to log into the server to continue the setup process in a couple of minutes.
It might take anything from 2-10 minutes for your new server to spawn.
Login to your new server
Once your new server has been created, you'll get its IP-address. You need this to log into the server at any point in the future. You'll also need to decide on a username for your private account on the new server.
Now it is time to login as root.
You'll be asked to verify that you want to log in to the server at that IP-address. Check that you typed the IP address correct and then answer yes. This will add the IP to a list of known hosts on your local machine, so you won't have to verify your intention every time you log into the server.
You'll only use the root user for logging in the first time. During the install process we will disable root login and after that you will only be able to log in using your new personal account. The root user will still be available for special task on the server – just not for logging in.
Ok, so now you've logged in to the server and it's time to change the root password. Type:
Then enter you new root password as prompted.
Creating your own personal user
It's time to set up your own user account on the server. Let's say we want to add a new account using the name __USERNAME__. Type:
You will be prompted to enter a new password and additional information about you. Only the password is required.
Now it is time to add sudo privileges for your new user. This means you'll be able to run the sudo command, which you are going to need as the maintainer of this server. Type:
You are now editing the sudoer's configuration file. This file is syntax sensitive, so be careful what you write. Somewhere in the output on your screen you'll find these two lines:
# User privilege specification
root ALL=(ALL:ALL) ALL
You'll want to add another line below these, stating the privileges of your new user:
__USERNAME__ ALL=(ALL:ALL) ALL
Save the modification by pressing CTRL+o (write) followed by CTRL+x (exit).
It is recommended that you keep the root connection open while performing the nexts tasks – so open a new bash terminal for executing the following commands. That way you still have a root connection if something is not working as planned.
Copying your SSH Key to the new server
IMPORTANT: This part is done from your local machine - not on the server.
Now it is time to copy your personal SSH-key to the new server. You do this by copying you local public key to the server with scp (secure copy).
scp ~/.ssh/id_rsa.pub __USERNAME__@__IP__:/home/__USERNAME__/.key
This is only copying your public key to a temporary location on the new server. The install script will finalize the setup of you key.
Login and run install script
You are now ready to login using you new personal account
And then enter the following to start the stack installer, which will guide you through the remaining steps of the process.
bash <(curl -s https://parentnode.dk/installers/install-ubuntu-server-stack.txt)
This will load a small script from this website and execute it. That, in turn, will clone the install tools and initialize the install process. Along the way, you will be asked to make some decisions and provide some relevant information.
Yup, it's that easy.
When the script has ended successfully, you'll be given a new login command including the specified SSH port, and the server will be ready for site deployment.
And remember you can easily run several websites from the same server, so you don't have to set up a new server for each project.
What is the script doing?
The script is a shell script and essentially just a long list of commands. It will install and configure the server as you decide, by running all necessary commands using your input. Any input you make will only be used while the script is running and not be stored permanently anywhere. If you want to know what the install scripts are doing you can read through the code in the open source repository on GitHub.
The install script also includes a set of handy helper shorthand functions/aliases, which will be added to your bash profile for your convenience.<
A shorthand to controlling Apache. comes with stop,start and restart.
Update apache configuration (if using git webserver.conf layout).
Why Ubuntu 18.04?
I have chosen Ubuntu as the Linux distribution for the parentNode stack, because of the combination of long LTS and large package availability. The LTS (Life-Time-Support) is relevant because it says something about how long into the future the current version is supported, and you don't want to have to reinstall your whole server too frequently just to keep getting updates. The large package availability means you have a very wide variation of software packages which can be added by running a simple command in the terminal.
I never access the GUI on any of my Ubuntu instances so the GUI aspect does not have any impact on my decision.
I'm also looking into using centOS for my webservers. If anyone out there have experience or recommendations in this area, please drop me a line (email@example.com) or leave a comment.