Posted on Leave a comment

Set up Linux LAMP server with WordPress

As a web developer it’s handy to have a personal web server that you can have full control over for hosting your PHP code. Alternatively, if you are looking to learn about Linux for the first time, I recommend setting up your first couple servers on a virtualbox installation. This article is a list of steps to help your set up a Linux Apache MySQL and PHP (LAMP) server quickly.

The target audience of this article is post-secondary web development students and new web developers who have need of a custom server for prototyping or hosting web sites and applications on or offline.


Download a Debian Linux installer from It’s important that you get the right image. The easiest of these to use are the CD or usb stick netinstall images. Ensure that you select the right image for your processor (i86 if you’re using virtualbox).

Install to your server or virtualbox. Mount the iso you downloaded from into virtualbox or burn it to a disc and boot your server from it. Keep it light, and try to avoid installing too many things you don’t need.

Screen Shot 2016-02-29 at 12.12.48 PMScreen Shot 2016-02-29 at 12.14.33 PM

Follow the Debian installer:

  • Select your language (English for me)
  • Select your country (Canada for me)
  • Select your keymap (American English for me)
  • set up your root user and your new user. I reccomend writing down these passwords.
  • select your timezone
  • Set up your disk. (use entire disk for me, then enter and yes for all options until the base system starts to install.)
  • Select your Debian mirror (Canada and for me)
  • When it comes to package selection, the following options are what I select for a basic webserver with an ssh server and standard system utilities
  • Screen Shot 2016-02-29 at 12.28.30 PMInstall grub to root of dev/sda
  • remove the disc or unmount the iso
  • boot into your new debian server and login with the user info you wrote down.

When your linux is ready, install sudo via the apt installer tool:

Edit sudoers file, adding your username & permissions then reboot

Log back into your system’s command line

Download wordpress from

Unzip the zip file

Copy the files to your webroot at /var/www/html

Set up a new user with a database in your mysql installation:

If you are using a hosting provider, you may already have a WordPress database set up for you, or there may be an automated setup solution to do so. Check your hosting provider’s support pages or your control panel for clues about whether or not you’ll need to create one manually.

If you determine that you’ll need to create one manually, follow the instructions for accessing phpMyAdmin on various servers, or follow the instructions for Using Plesk, Using cPanel or Using phpMyAdmin below.

If you are installing WordPress on your own web server, follow the Using phpMyAdmin or Using the MySQL Client instructions below to create your WordPress username and database.

If you have only one database and it is already in use, you can install WordPress in it – just make sure to have a distinctive prefix for your tables to avoid over-writing any existing database tables.

get the ip of your virtual server

Type the IP of your virtualbox installation into your browser on your PC or Mac to start the WordPress installer

Complete the WordPress installer, and voila your server is running wordpress.

There’s a lot more your Linux server can do, you just need to do some research and bam you can have fantastic results.