WordPress is a complete content management system with thousands of plugins, widgets, and themes. In this tutorial we’ll review how to build and deploy WordPress to a server running Ubuntu 14.4.
This tutorial takes advantage of Distelli’s powerful continuous delivery platform to install and configure:
- Web Server (Nginx)
- Database (MySQL)
NOTE: This is designed for a 1 time deployment which will install wordpress. It is not made to run more than once on a server.
NOTE: This is designed specifically to deploy to Ubuntu 14.
Step 1. Create a Free Account on Distelli
In a browser navigate to https://www.distelli.com/signup and sign-up for your free Distelli account.
Step 2. Set Deployment Instructions
The Distelli deployment instructions are in a distelli-manifest.yml file. This file and an Nginx configuration file are available in a Distelli public GitHub repository at:
Fork this repository to your GitHub account.
Step 3. Create an Application in Distelli
In Distelli, click the Applications link at the top of the WebUI. Then click the New App button on the top right.
Give your application a name. Use the name wordpress. This name has no bearing on your WordPress site.
The application name must match the application name in the distelli-manifest.yml file.
After entering a name, click the Use GitHub button.
If the button instead says Connect GitHub click that and connect your GitHub account.
Select the repository you forked from step 2 above.
Choose the master branch.
Two environments will be automatically created for you. Click the All Done button to continue.
At this point, you will pause the new application workflow and edit the deployment instructions before continuing.
Step 4. Edit the Distelli-Manifest.yml File
You already have a distelli-manifest.yml file provided in the repository you forked earlier. You must edit this file and commit the edit to your repository.
Edit the distelli-manifest.yml file.
Set the values as appropriate:
- SET_ME_DISTELLI_USERNAME = This should be set to your Distelli username you created when you signed up. For more info see: Finding Your Distelli Username.
- MYSQL_ROOT_PASSWORD: “
” = The root (master) password for the MySQL database server.
- DB_NAME: “
” = The name of the WordPress database you wish to create.
- DB_USER_NAME: “
” = The user that has full permissions to the WordPress database.
- DB_USER_PASSWORD: “
” = The password for the WordPress database user.
Leave all the other content in the file alone.
Note: wordpress is the name of the application. This must match the name you gave the application in Distelli.”
Here is an example edited manifest:
johndoe/wordpress: Env: # Set the variables below - MYSQL_ROOT_PASSWORD: "pa55w0rd" - DB_NAME: "wordpress_db" - DB_USER_NAME: "wordpress_user" - DB_USER_PASSWORD: "wordpress_user_password"
Save your changes. Commit the changes to your repository.
Step 5. Build the Application
Go back to the Distelli WebUI and click the I’ve pushed my Repo button.
Click the Looks good. Start Build! button.
The build that is kicked off will validate that you have the correct Distelli user name and your application name matches. After a successful build, a software release will be created. For more information on builds see Viewing Builds.
If you are not on the builds list page, click the Builds button at the top of the Distelli WebUI.
Your successful build will be at the top of the list.
Click the New Deployment button at the top right to begin a deployment
Step 6. Deploy the Application
In the new deployment wokflow step 1, click Deploy a Release.
Select the application you wish to deploy.
Select the release you wish to deploy. You should only have the one release created from the successful build.
Select the -prod environment. If you have been following along with the same application name (wordpress) the environment will be named wordpress-prod, select that.
You currently don’t have any servers associated with environments. At this point, you will have to login to your server and install the Distelli agent. Click Add Servers button.
Step 7. Add a Server
To facilitate a deployment of WordPress from Distelli, you must install the Distelli agent on the server. Instructions for installing the agent can be found in the Distelli Agent reference guide.
Now return to the Distelli WebUI and click the Add Servers link at the top to refresh the list. Once your server is added to the list, select it, then click the Add Servers button.
Step 8. Start a Deployment
Close the Servers dialog and click the Start Deployment button.
WordPress is now being installed on your server.
Step 9. Using your WordPress Site
After the deployment is successful, you can begin setting up your WordPress site. In your browser, navigate to the IP address associated with your server:
That is it. You are up and running. Have any question? Feel free to shoot me an email at email@example.com.