Local WordPress development on Ubuntu is super easy

December 5, 2017 - Linux

If you are tired of changing localhost domain to the correct one before the siteis published this tutorial is for you. We will create a local domain so that your site will be available on during development – only on your local machine.

First download the latest WordPress from and then follow the instructions below.

# Move the downloaded zip to `/var/www/`
mv /home/XXX/Downloads/

# unzip it

# rename the directory to a project name 
mv wordpress project

# setup the apache host 

cd /etc/apache2/sites-available 
cp 000-default.conf project.conf 

# edit the conf file 
vi project.conf

# change the following lines to match your project
DocumentRoot /var/www/project

# enable the page 
a2ensite project.conf

# restart the server 
systemctl restart apache2 

# check the local ip
ip a

# add the domain name to the hosts file 
echo "<LOCAL IP>" >> /etc/hosts

Before the installation change the wp-config.php file and include mysql data (host, database name, username, password).

Then go to in your browser and start the installation.