To run a Linux server, all you need is a physical machine on which to install a Linux distribution, an 1
Internet connection and a static IP address that doesn't change so that your server will be easily 2
reachable. Even though you can set up everything easily from scratch 3
I'll show you another approach. We’ll run a VPS, which is short for a virtual private server, at a cloud or hosting 4
provider. 5
Of course, you can set up everything in the same manner on your own machine or even in a VM. 6
But what is a VPS? A VPS is like a dedicated server, 7
so like a physical machine you control. You are given root access and you are able to configure the server 8
the way you like. 9
You are almost in full control, like having your own server, but you don't need to maintain the hardware. 10
I chose 11
Digital Ocean as the hosting provider because in my opinion, it offers the best performance 12
per dolar. Even more, when you open a new account, it will be credited for free with some dollars so 13
that you can use their service for 60 days. 14
I have already an account and I'm logged in. 15
The next step is to create the VPS. The Digital Ocean name for the VPS is droplet, 16
so I'm going to create a new one under my account. 17
I'm going to control panel. 18
I'm clicking on create and I'm choosing droplets. 19
Digital Ocean Droplets are Linux based virtual machines that run on top of virtualized hardware. Each 20
of these created droplets is a new server you can use. 21
You can do it either stand alone or as part of a larger cloud based infrastructure. 22
As you can see, the droplet comes with Linux preinstalled so you can focus on deploying the apps. Digital 23
Ocean offers a wide variety of operating systems like Ubuntu, Free BSD, Fedora, Debian or CentOs. 24
I'm choosing Ubuntu. 25
Based on the project size and requirements, the VMs are offered in a mixture of memory and compute 26
resources. And I'll choose the second one, which costs ten dollars per month. 27
Then you have to choose the data center region; it's recommended to be as close as possible to your 28
clients. 29
So if most of your clients are located in the USA, then choose New York on the East Coast or San Francisco 30
on the West Coast. 31
In my case, being located in Europe, I'm choosing Frankfurt. 32
If you need IPV6 services selected under additional options and monitoring, if you want automated 33
droplet monitoring and alerting. 34
Next, I'll set up the ssh authentication method to the server. 35
There are two ways to authenticate to the server using ssh: public key authentication or password authentication. 36
If you select ssh keys, the passport authentication will be disabled and your droplet will be protected 37
against 38
brute force attacks. However, you have to generate the key pair first and paste the public key here on this 39
page. 40
Just to get it started, I'm choosing password authentication for the moment, but in the next lecture, 41
I'll show you how to configure the ssh keys because this is a more secure way of authenticating to the 42
server. 43
I'm using the suggested strong password for the root account. 44
This is a very good one; save it in the password manager or keep it safe somewhere. 45
I'm deploying a single droplet and I'm leaving the suggested hostname; you can change it if you want. 46
Finally, for a small amount of money, you can enable automatic backups. 47
This is highly recommended, especially if you're run a production server and I'm creating the droplet. 48
It will take a few seconds, and after that, we'll have one Ubuntu server running in the digital ocean 49
cloud. 50
It's creating it. 51
I'm clicking on its name. There are two ways to connect to the server: using the console, which opens 52
on a Web page or using ssh. 53
This is the console. In both cases, we are authenticating using root. 54
And I'm in as root. I've used the password specified when I created the droplet. 55
However, ssh is the most common way to configure the server; the console will be used only 56
when ssh message is not working, like in the case of one network fault. 57
You should know that the console is always available, even though the network interfaces are down or 58
a firewall is blocking you. 59
Let's connect to the droplet using ssh. First, let's find its public IP address; this is its public IP 60
address, which is statically configured so it doesn't change. 61
And I'm connecting to it using an ssh client. You can use the Linux ssh command or putty if you 62
are connecting from Windows. 63
So it's ssh -p22, the default port root@ and the IP address. 64
And I'm entering the root password. 65
And I'm in; the only thing I'll do for the moment is to fully upgrade the server using apt. 66
So apt update && apt full upgrade -y it assumes 67
Yes 68
to any questions. 69
I'm logged in as root, so it's not necessary to run the commands with sudo. 70
We are taking a short break, and in the next lecture, I'll show you how to secure a ssh.