Debian Linux Post Install Notes

I have just installed a new Debian Linux server, this will be running mainly as a web server without a GUI and console access will be via an SSH login, some knowledge of using Linux is assumed as these notes are intended as a prompt or overview of things to do to as part of a Linux server installation.

I am using Debian version 11.2 – Bullseye, the current version at time of writing, but these notes should work with any distribution that uses the apt package manager like Ubuntu. The ISO image used for installation came from https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ and I have used the Xfce install: debian-live-11.2.0-amd64-xfce.iso (2.4G download). A guide for installing the Debian image can be found on this TecAdmin page.

At the Console

Your computer is now inviting you to login, do so with your local user and once the default desktop has been created open a terminal window to complete the following; switch to the root user and add your local user to the sudoers group:

Now logout and back in, this updates your user account settings, and go back to the terminal to update the system, install ssh access and a couple of useful tools, and finally set the computer to boot to console rather than the GUI:

If you have installed into a virtual machine now is a good time to install the guest client, links to popular VM’s:

Finding your IP address is useful:

In this instance it is 192.168.1.20. For a server I would normally fix the IP address in my router as a Reserved Address using the MAC (in this case: 02:11:32:23:83:6c).

Removing libreoffice clears a useful amount of diskspace:

Restart with $ sudo reboot You can now login via SSH from your other computer or continue at the console.

Installing the LAMP service – MySql, Apache and PHP

Start with MySql (MariaDB being the open source version), installing, configuring and starting:

For the secure installation, use the defaults and set the password when prompted. Next is Apache and PHP:

Point your web browser to the server address, in my case: http://192.168.1.20, and you should see the default Apache page. The web pages are in /var/www I normally add a symbolic link and change permissions on the html directory so I can add files easily:

Accessing a Network Drive

I want to be able to access some network drives from this server, these are setup as Windows (SMB) file shares.

create a file with your file share username and password, this should go into /etc, I normally call the file the name of the server I want to connect to, and set permissions so it is only readable by root:

And add the connection to the end of your /etc/fstab file, and mount the drives:

Check that it mounted with $ df -h. The file share will also automatically mount at boot.

Other Useful Things

Installing a downloaded .deb file with dependencies, in this case for the no longer manufactured Logitech Media Server:

Links and Sources