Server - Contents

The Fundamental Setup

- establishing a server accessible by an IP

revised: 19-Feb-2022

These first steps will create the server [Debian 10.3 64bit "Buster"] and establishing means to upload/download files together with a graphical comprehensive control panel[Webmin].

It is worthly to note here that one will be working within a "console/monitor" environment, very unlike the common graphical ones. The steps are presented in a manner to make this experience minimal - that said, it would be very useful to have some familiarity with this environment. Once the server is up and running, one may wish look at some very basic bash commands and Linux commands. Of the many such guides, have a look a this one: Linux commands to A Beginner's Guide to the BASH Terminal

The server intended in these pages, are for services only and not for significant data storage. Hence a server space of even 10Gb is more than enough.

The Steps

Step01 Establish an account with Linode (preferred) or DigitalOcean: Apart from establishing the usual username and password process, one is required to have a credit card. Once login, one will "Add a Linode" (it is highly recommended you choose one of at least 2Gb RAM and, the following two points comes highly recommended, allocate only 10Gb of the 25Gb provided --via Disks/Configs, one will have space to clone the server as a backup and save that image within the same storage. Secondly to resize the swap disk from 512Kb to 2048kb). There is also the option to create a DigitalOcean "droplet" (without the resizing advantages), choosing in all cases, Debian 10.3 64bit as the operating system. Both providers will allow one to enter a public key (from one's SSH public/private key- see: More Secure Logon - SSH). If one has chosen not to use the SSH key pair (not recommended), either one of these providers will either send a welcome email containing two critical bits of information: the site IP address [a number with 4 parts] and the user: 'root' password or provides the opportunity to set the 'root' password prior to the creation of the server

Step02 Using PuTTY, see reference: DigitalOcean - using SSH key with PuTTY. Open the application: PuTTY on your computer. PuTTY will open to its configuration page. In the dialogue box below the sub-heading "Host Name (or IP address)", copy and paste the IP address from the welcome email. The port can be left blank and the button active beside "SSH". As described in the linked tutorial, "Working with PuTTY's Public Key Format", set PuTTY to link up with one's private key. As PuTTY logins into your server, one will initially receive a warning: choose to 'accept' to continue.

Tip#1: After entering your IP number, if you also type in a label such as "MyServer" in the dialogue box below the sub-heading "Saved Sessions" and click on "Save", PuTTY will open in future to your server if you double clicked that label now appearing in the list.
Tip#2: There is a way to "Copy & Paste" text from the Windows environment to the Linux one. Having done the usual "copy" of some text, one clicks on the open PuTTY terminal, then right-click to enter text. This often (but not always) works for entering passwords - although no visible entry is seen.

Step03 At the first login with PuTTY, a dialog warning is produced -- accept the connection. The first request(if one has not used a SSH key-pair) from the PuTTY terminal will be [login as:] Enter the username: root and press the Enter/Return key. The second request will be for the password. From the initial server setup, one should have the root password, copy and paste (see Tip#2) this password and press the Return key.

Step04 One should now be successfully logged in to the server. Now create the password for user: root // one that has at least 12 characters. Should one need to create another password, one can create handy but a very strong and memorable password to replace it - for good suggestions see: Passwords With the new passward handy to copy, enter this command in the terminal: passwd that follows after '#'):

root# passwd

Step05 The following commands need to be entered (via cut & paste) and their actions completed sequencely:

root# apt update
root# apt -y upgrade

Step06 Preparing for the Webmin control panel: Enter similarly the following three commands:

Based on Install Webmin on Debian 11 by kafirunix.com - recommended section: Install Webmin using Webmin DEB binary (updated for webmin_1.984) The earlier presentation (same section) is also useful:Install Webmin on Debian 10
root# wget https://prdownloads.sourceforge.net/webadmin/webmin_1.984_all.deb
root# apt install ./webmin_1.981_all.deb
root# /etc/webmin/start
root# ss -altnp | grep 100 // a simple check to see if it is running
root# systemctl status webmin // another check, use 'ctl-c' to exit.

Step06 Opening Webmin: Once the install process is complete, type in this link in one's browser: https://[IP address]:10000. One will get the warning along the lines of "Connection not Protected". Ignore this warning and advanceto make the exception. Thereafter, this should lead one to the login page of the server's Webmin control panel.

The username for Webmin will be 'root' and its password.

Tip#3: Whenever one logs into Webmin, it alerts one to programmes on the server that need updating and there is a page within that makes this updating a one-click process. It is good practice and security to keep the server up-to-date.

Reaching and completing successfully Step06, one has now a functionally and accessible server. The graphical interface: Webmin now offers many advantages in future configuration work. However given the nature of the Internet, one needs to immediately secure the server with a firewall, the fail2ban app and finally Proftp as means to upload/down files.

Backing Up the Server - Option for Linode/Digital Ocean clients

Here recommended are two straightforward methods - both are to be done:
1. Provider Backup: For USD2.50/month, Linode will perserve a daily snapshot of the server and hold snapshots for 10 day. One can also force a snapshot to be taken at any given time. A snapshot enables one to restore the server to the time the snapshot was taken. For Digital Ocean, the cost is USD2.00/mo for the USD10 droplet. Information on how that works can be found at: Backups_Quickstart.
2. Backup the Main Image (Linode only): Having a storage space of 25Gb with the USD5 Linode package or 50Gb with the USD10 Linode package and assuming one has only allocated 10Gb to the server as suggested above, there is room to 'Duplicate' the image (duplicating the swap image is unnecessary) via the Linoda Management Cpanel. Once one has duplicated the image, it can be labelled with the date of the backup eg 'Debian10-201102'. Whenever there are significant changes to the server, one simply erases the older image and replace it with the current one - or better, add a second duplicate image (storage space permitting.)

Alternative Manual Backup - Linode Only

Step#1: Resize the Main Disk: Normally, there are two disks; the main disk (on /sda) and the swap disk (on /sdb). Power off the server. Open your Linode and go to tab "Disks/Configs)" and within the options given, via the right-side button, resize the image "Debian10 Disk" to reduce it to 10Gb.
Step#2 Clone the Main Disk: Secondly clone the image, rename the clone to include the date and store it within the provided storage. With these two methods applied in the case of Linode, the risk of losing outright the server is greatly minimized as one can restore the server, using this back-up image or a recent snapshot. One should have arrived at a similar situation as describe in the screenshot below:

Linode-Clone

To Restore from a Clone

Step#1:Delete the Main Image Power off the server. Open your Linode and go to tab "Disks/Configs)" and within the options given, via the right-side button, first delete the image "Debian10 Disk".
Step#2 Edit the Linode Configuration Go your profile (eg.My Debian 10 Disk Profile) under "Label" and choose "edit". In the configuration dialogue, go to the section "Block Device Assignment" and for dev/sda: choose your cloned image (eg.'Debian10-201102'). Then click on "Submit".
Step#3 Choose the Profile for BootUp From the same profile, choose the option: "Boot this Configuration". Recommendation: Prior to powering on the server, make another clone, labelled with the current date.

For other VPS -- that have provided no swap disk

Based on How to Add Swap Space on Ubuntu 20.04 by Linuxize.com These essential bash commands to provide a 2G swap disk:
root# fallocate -l 2G /swapfile
root# chmod 600 /swapfile
root# mkswap /swapfile
root# swapon /swapfile
root# nano /etc/fstab // paste at bottom of file
/swapfile swap swap defaults 0 0
root# swapon --show // check that it is operational
root# nano /etc/sysctl.conf// paste at bottom of file
vm.swappiness=10 // for a production server -- can be higher.
Server - Contents