Setup a LAMP Server on Debian or Ubuntu

This setup is for Virtual Host server – not a dedicated server with a single domain

SSH to your server
ssh root@IP
Update Debian/Ubuntu
apt-get update && apt-get upgrade --show-upgraded -y
Create User

How To Create a User in Linux

Setup SSH for Remote Access With GPG Keys – No Password

How To Setup SSH for Remote Access

IMPORANT – Block All Traffic to your Server While You Set it Up

Block All Traffic (but mine) to a new Server

Achtung! Do not install Apache/MySQL/PHP before hostname is set exactly the way you want it.

Edit hosts file on the remote server (not your local pc).

sudo vi /etc/hosts

add after ( localhost) server1

Be careful with this line (above), its easy to leave the last part off (server1) and cost hours tracking down what went wrong.

sudo vi /etc/hostname

add this only line


Check if hostname is Set Correctly

output should be


hostname -f

should be

Set timezone
sudo dpkg-reconfigure tzdata
Solve Future DNS Problems with OpenDNS

Bullet-Proof Your DNS

Install Rsync

Install Rsync

Install Apache

Install Apache

Install MYSQL Server

Install MYSQL Server

Install PHP

Install PHP for WordPress

Harden LAMP

Harden LAMP

Submit your review

Create your own review

Webmaster Notebook | SELeads
Average rating:  
 1 reviews
 by Eric Eronsson
Exactly What I Needed

Thanks for the grat work.

You may also like...