How to use the WordPress One-Click Install on DigitalOcean
WordPress is one of the most popular content management and blog platforms in the world. It allows you to easily create and manage a website and provides a practically endless number of plugins and themes for extra functionality. This tutorial will give you all of the details you need to get your WordPress site set up quickly.
In addition to what comes on a regular Ubuntu 16.04 Droplet, the WordPress one-click image includes the following components:
- Apache: The most widely used web (HTTP) server.
- MySQL: A commonly used open-source relational database.
- PHP: PHP language support.
These components comprise what is known as the "LAMP" stack, a group of open source software that is typically installed together to enable a server to host dynamic websites like WordPress. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.
Additionally, in order to improve security the following additional components are included:
- iptables: A standard firewall included in most Linux distributions by default
- UFW: A front-end to iptables that allows for easy management of a firewall.
- fail2ban: A service that automatically updates your firewall configuration to block attackers.
In just a bit, we'll get into the details of how to configure your WordPress site - including how to configure your domain - where your MySQL password can be found, and how to access your MySQL database.
Create Your WordPress Droplet
If you have already created a Droplet with the WordPress on 16.04 image, you can skip this section. If you haven't created a WordPress on 16.04 image Droplet, follow the steps below to get set up.
To get started, click Create Droplet from the Control Panel, then add a Droplet hostname and select your Droplet's size.
Note: the WordPress one-click application only works on a Droplet with 1GB of CPU or higher.
Select your desired region:
In the Select Image section, click the Applications tab and choose WordPress on 16.04.
Next, select from additional settings to configure private networking, IPv6, or backups on your Droplet.
Finally, select which SSH keys - if any - you want to use to access the Droplet and click the Create Droplet button.
Check the Placeholder Page
Once your Droplet creation is complete your new droplet will serve a placeholder page like the one shown below if you visit your Droplet's IP address in a browser.
Prior to using WordPress, you will need to enable it by logging in to your Droplet via SSH. This is a security measure that has been put in place to protect the initial configuration of WordPress, in which the administrative user is set up.
When you are ready to configure, and start using, your WordPress site, move on to the next section.
Access the Droplet via SSH
Once your Droplet has been created, you can access it by connecting to your Droplet as root via SSH. This will enable the WordPress installation on your Droplet.
Note: If you haven't used SSH or PuTTY before, you may want to refer to this tutorial for more details: How To Connect To Your Droplet with SSH.
Open a terminal on your computer and log in to your Droplet as root via SSH with this command (substitute with your Droplet's IP address):
If you are prompted for a password, enter the password that was emailed to you when the Droplet was created and follow the on-screen prompts to replace your temporary password. Alternatively, if you set up the Droplet with SSH keys, the keys will be used for authentication instead. You can now safely close out of the session.
After your WordPress installation has been enabled by logging in to your Droplet via SSH, visit your Droplet's IP address in a web browser. You should see the following page:
Follow the on-screen prompts to select your language, give your site a name, and configure your administrative user (and be sure to set a strong password for added security).
Once you have completed these steps, you will be taken to the login page for your new blog. Log in with the administrative user you just created and continue to set up your site.
Configure Your Domain
To point a domain name to your Droplet, follow the steps in the setting up a hostname tutorial. Once your domain name is resolving to your WordPress Droplet, you will want to update your WordPress configuration to use it.
Log in to your WordPress admin panel at http://DROPLET_IP_ADDRESS/wp-admin using the account you created earlier. Click on General under Settings in the navigation bar on the left-hand side of the page. Here, you will see several options you can configure for your site. Update the WordPress Address (URL) and Site Address (URL) fields to reflect your new domain name and click Save Changes.
Your WordPress is now usable. From the admin panel, you can customize your site's appearance, install plugins for added functionality, or create a new post or a page.
Logins and Passwords
You can find additional details of your new installation in the MOTD (Message of the Day) which is displayed when you log into your droplet via ssh:
------------------------------------------------------------------------------- Thank you for using DigitalOcean's Wordpress Application. Wordpress has now been enabled. You can access your Wordpress instance at: http://18.104.22.168 The "ufw" firewall is enabled. All ports except for 22, 80, and 443 are BLOCKED. To secure your Wordpress installation, fail2ban has been configured and the Wordpress fail2ban plugin is a site enforce module in. If you do not want to use this plugin, remove /var/www/html/wp-content/mu-plugins/fail2ban. You are encouraged to run mysql_secure_installation to ready your server for production. The passwords for MySQL and the Wordpress users have been saved to: /root/.digitalocean_password Let's Encrypt has been pre-installed for you. If you have a domain name, and you will be using it with this 1-Click app, please see: http://do.co/le-apache You can learn more about using this image here: http://do.co/wordpressapp -------------------------------------------------------------------------------------
If you need to access your MySQL database server you can find your MySQL root user password in the
Once you have your password, access your MySQL server from your terminal by typing:
mysql -uroot -p
and providing your MySQL root password.
If you prefer to use a graphical user interface to manage your database through your web browser, you can install PHPMyAdmin on your Droplet. To install PHPMyAdmin, first you should update your package manager's list of available packages and then install the
apt-get update apt-get install phpmyadmin
When asked if you want to auto-configure a web server, select No. You will also be prompted for your MySQL root password during this process so be sure to have it handy. Once this process completes you should add the following line to the end of your
You can insert this line with a single command by running:
echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/sites-enabled/000-default.conf
Next restart Apache with the command:
service apache2 restart
You will now be able to access PHPMyAdmin by browsing to http://YOURDOMAIN/phpmyadmin or http://DROPLETIP/phpmyadmin if you have not yet configured your domain.
Your WordPress site should be up and running. It is recommended that you enhance its security by following these steps:
- Follow our Initial Server Setup guide to give
sudoprivileges to your user, lock down root login, and take other steps to make your VPS ready for production.