Installing WordPress on Azure

There are several different ways to host WordPress using Microsoft Azure. The two options I am going to investigate are:

  1. Virtual machine
  2. App Service

Possibly the simplest method to install WordPress on Azure is to use the Bitnami Azure package. Bitnami provides packaged applications for many platforms and simplifies the server set up process.

Click create and you are prompted for a number of server configuration options.

App Service


Sometimes when you try to push code to a remote git repository, you may come across this error:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

Here are a few things to check on a mac.

Start the ssh-agent with this:

eval `ssh-agent` 


ssh-add -l

This will list any keys already added to the ssh-agent. If no keys are presently added, 

The agent has no identities.

will be shown.

Add your key by running:

ssh-add -K ~/.ssh/your_private_key

Dev Ops for WordPress Part Three


Here are the steps to get up and running with Trellis.

For further information, please visit the Trellis documentation or visit the roots discourse –

Local development setup

Create a directory on your local computer, 

mkdir && cd

Make sure you have write permissions to the folder then grab a copy of Trellis from the git repository.

git clone --depth=1 && rm -rf trellis/.git

Do the same for Bedrock

git clone --depth=1 site && rm -rf site/.git

Edit the development sites file


In this file, replace any reference to “example” with the correct name of your site.

Edit the development vault file


Again, change example to the correct site name and change any of the development passwords if required.

Change to the trellis directory in your terminal


then run the vagrant up command

vagrant up

Enter your administrator password when requested. Then sit back and allow the magic to happen. Your dev site will be ready in between 0-10 time units. How does that even work? Well, I’m not going to go into it here, but it does! Most times. Unless you have permission issues or other minor tweaks that need to be made. A bit of googling will normally get things flowing, but drop me a comment if you get any weird errors 🙂

Staging / Production

Using vi

vi is a text editor originally developed for UNIX but now included with Linux distributions and macOS.

It will take a little while to memorise some of the vi commands, but stick with it. Learning vi will greatly speed up simple file edits both for your local dev environment (if you are on a mac) and on your Linux server.

Its strength lies in being able to make quick edits to files without having to load big IDEs

vi is a modal editor with two modes, normal mode and insert mode. In normal mode key presses are interpreted as commands. In insert mode, text in the file can be manipulated.

To change between the two modes use press


to switch to insert mode then


to move back to normal mode.

Here are some more useful vi commands that will make editing files on Linux quick and easy:

Normal Mode

G – Move cursor to the end of the file
1G – Move cursor back to the beginning of the file
dd – delete line
3dd – delete 3 lines (substitute 3 for any number of lines)
:q – Quit, i.e. close the file
:qs – Quit and save
:q! – Quit and do not save

Insert mode

i – insert text before cursor
a – insert text after cursor
A – insert text at the end of the line
Esc – Leave insert mode

DevOps for WordPress Part Two

Today is V-Day. I think my next sentence contains the most Vs in any sentence in the history of the English language.

In this post I examine Vagrant, Varying Vagrant Vagrants and Variable VVV and how they can be used to simplify development environment setup.

Yes, really, those are their real names.

Virtualisation is a key component of  DevOps for local development environments. Virtualising your dev setup provides a number of benefits including ease of replication and an increased ability to automate repetitive tasks.

These three tools, used together, provide an automated process for quickly and simply creating local virtual development environments for WordPress.


Vagrant is an open source software tool to create and manage local development environments. Vagrant is used in conjunction with other virtualisation software such as VirtualBox or VMware.

Varying Vagrant Vagrants

Varying Vagrant Vagrants is an open source vagrant configuration tailored for WordPress development. VVV includes required software for WordPress development including NGINX as the webserver, MariaDB for the database and PHP.

Variable VVV

Variable VVV builds on top of Varying Vagrant Vagrants to further improve and automate the setup process.

Set up a local dev environment using Variable VVV.

Install all the required software:

  1. Vagrant
  2. Varying Vagrant Vagrants
  3. Variable VVV

Once all the requirements are installed, setting up a development WordPress site is as easy as browsing to the local vagrant directory directory, in my case:


and typing

vv create

Variable VVV will then ask a series of questions about your WordPress install and, all things going well, set up a working WordPress development environment for you.

Image showing Variable VVV set up using terminal on a Macbook

DevOps for WordPress Part One

In this series I examine a number of options for setting up working DevOps processes in a WordPress development context. Through a number of examples I demonstrate how DevOps can be utilised to improve our development practice by promoting a professional, structured approach to managing WordPress development.

But first, a quick introduction. What is DevOps other than a pretty cool sounding name reminiscent of SpecOps?

DevOps is a term covering a wide range of tools, technologies and processes. Expanding the word helps to understand its meaning. DevOps stands for Development Operations and revolves around the tasks necessary to efficiently manage the development process. A particular focus of DevOps is the automation of regular activities.

DevOps can provide benefits to processes throughout the entire development infrastructure. From setting up a local development environment to managing releases to the production environment.

There are many reasons to include DevOps in your WordPress development workflow. These benefits include:

  • Increased speed and consistency of development
  • Increased efficiency and reliability of deployment
  • Improved quality of final product
  • Increased speed of delivering final product

The main areas I focus on are:

  • Development
  • Testing
  • Deployment

DevOps is not a quick fix. It requires careful planning and preparation with a particular motivation to develop and deploy in a structured and organised manner.  If your aim is to quickly set up a one-off website which will require little or no maintenance then spending time on a DevOps set up will likely be overkill. However, if you need a repeatable and professional practice for consistently developing quality websites then it is going to be time well spent.

While the initial setup and configuration will take some thought and time, the benefits will soon make themselves apparent.


I will examine and demonstrate a number of tools available for DevOps processes. These will include:

Varying Vagrant Vagrants
Variable VVV*
Roots Trellis and Bedrock

* Really? Variable Varying Vagrant Vagrants?!

WordPress Permissions

WordPress permissions and your ability to alter them will vary widely depending on your hosting arrangements and server software. Here are my server settings based on a self managed Digital Ocean droplet running Ubuntu 16.04 and NGINX.

While your setup might well be different, there are many commonalities that will be appropriate for any hosting environment.

The recommended settings for WordPress directories and files are as follows:

Directories should be set to 750

Files should be set to 640
except wp-config.php which should be 440 or 400.

Set directory permissions

find /srv/www/your-site/ -type d -exec chmod 750 {} \;

Set file permissions

find /srv/www/your-site/ -type f -exec chmod 640 {} \;

Set wp-config.php permission

sudo chmod 440 your-site/wp-config.php

Define the fs method in wp-config.php

define('FS_METHOD', 'direct' );

Development Environments

When you are developing web applications, whether it is a Python REST API or an internal SharePoint solution, having a smooth development workflow is closely tied to having the right development environments.

Typically this would involve three or four seperate environments: