{"id":2164,"date":"2020-06-08T07:36:06","date_gmt":"2020-06-08T04:36:06","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/set-up-multiple-wordpress-easyengine\/"},"modified":"2020-06-08T07:36:06","modified_gmt":"2020-06-08T04:36:06","slug":"set-up-multiple-wordpress-easyengine","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/set-up-multiple-wordpress-easyengine\/","title":{"rendered":"How to set up multiple WordPress sites with EasyEngine"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Build your own lightning-fast WordPress development server with UpCloud &amp; <a href=\"https:\/\/easyengine.io\/\" target=\"_blank\" rel=\"noopener\">EasyEngine.io<\/a> in just a few minutes. EasyEngine is a powerful CLI tool which is used to deploy WordPress sites. EasyEngine utilizes the power of Docker without you needing to know anything about Docker. With EasyEngine you can easily deploy new and fresh WordPress sites with just one command.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/signup.upcloud.com\/\">Test hosting on UpCloud!<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up a cloud server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Go ahead and deploy a new UpCloud server with Ubuntu 18.04 by logging in to your <a href=\"https:\/\/hub.upcloud.com\/\" target=\"_blank\" rel=\"noopener\">UpCloud Control Panel<\/a> and clicking <em>Deploy server<\/em>. Please note that EasyEngine v4 does not support CentOS. If you are new to UpCloud, you can get started with the free trial by <a href=\"https:\/\/signup.upcloud.com\/\n\/\" target=\"_blank\" rel=\"noopener\">signing up<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you\u2019ve deployed a new cloud server, <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/connecting-to-your-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">log in<\/a>\u00a0using your favourite SSH client. One option is to use <a href=\"https:\/\/www.royalapps.com\/ts\/win\/features\" target=\"_blank\" rel=\"noopener\">Royal TS<\/a> which can manage various remote control credentials all in one place.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial Ubuntu server setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When deploying new cloud servers, it\u2019s good to follow a common setup routine to get the server prepared. We recommend you follow the steps below to update and secure your cloud server before installing EasyEngine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While logged in as root, run the following commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update and upgrade your Ubuntu server. It\u2019s important to make sure you keep your server up to date to avoid security vulnerabilities caused by outdated software.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt update &amp;&amp; apt upgrade -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should also install a UFW firewall which can be used to only allow traffic to SSH, HTTP and HTTPS (ports 22, 80 and 443) to add an extra layer of protection to your server. Alternatively, you may wish to check out <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/managing-firewall\/\" target=\"_blank\" rel=\"noreferrer noopener\">UpCloud\u2019s L3 firewall<\/a> feature in your cloud server\u2019s settings.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install ufw -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you installed UFW, add the following rules and then enable the firewall.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ufw allow ssh\nufw allow http\nufw allow https\nufw enable<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Lastly, set up a new account with sudo privileges. It\u2019s a good practice to use a non-root account for connecting to your cloud server and restrict SSH to prevent login with the root account. This is done to greatly reduce the chance brute-forcing your password would be able to gain access to your cloud server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">adduser new-user\nusermod -aG sudo new-user<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Login to your new user in a new SSH session. Now let&#8217;s setup SSH keys to further harden your server\u2019s security. Please check out this tutorial on <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/use-ssh-keys-authentication\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to use SSH keys for authentication<\/a> and how to harden your SSH service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you\u2019ve prepared your cloud server, you can go ahead and install EasyEngine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up EasyEngine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With the cloud server prepared, you can go ahead and install EasyEngine itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">EasyEngine has made the installation process ridiculously easy. Simply run the following command while logged in to your sudo privileged user and wait for EasyEngine to install.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget -qO ee rt.cx\/ee4 &amp;&amp; sudo bash ee<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The script will install all required dependencies as well as the actual EasyEngine tool.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While the installation is going on in the background, you should consider setting up a domain for your development server if you haven\u2019t yet. This way you can use subdomains for each WordPress you would like to spin up and easily have multiple concurrent WordPress sites on a single cloud server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the installation process finishes, you\u2019ll see an output similar to the example below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------------+-----------------------------------------------------------------------------+\n| OS                | Linux 4.15.0-99-generic #100-Ubuntu SMP Wed Apr 22 20:32:56 UTC 2020 x86_64 |\n| Shell             | \/bin\/bash                                                                   |\n| PHP binary        | \/usr\/bin\/php7.3                                                             |\n| PHP version       | 7.3.18-1+ubuntu18.04.1+deb.sury.org+1                                       |\n| php.ini used      | \/etc\/php\/7.3\/cli\/php.ini                                                    |\n| EE root dir       | phar:\/\/ee.phar                                                              |\n| EE vendor dir     | phar:\/\/ee.phar\/vendor                                                       |\n| EE phar path      | \/home\/new-user                                                              |\n| EE packages dir   |                                                                             |\n| EE global config  |                                                                             |\n| EE project config |                                                                             |\n| EE version        | 4.0.17                                                                      |\n+-------------------+-----------------------------------------------------------------------------+\n-----&gt; Run \"ee help site\" for more information on how to create a site.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Afterwards, you can get started setting up your first WordPress site with EasyEngine!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring domain name records<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To be able to reach the WordPress sites running on your EasyEngine server, you will need to have configured a <strong>domain name A record<\/strong> to point to your cloud server. The actual process of creating domain name records depends on your domain registrar but you can find out generalised instructions in the following guide to <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/domain-name-system\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to manage DNS records<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With a valid domain name, you can use subdomains to create as many websites with EasyEngine as you want.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating WordPress instances<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">EasyEngine has an extensive library of various commands you can run straight from your SSH terminal. Let\u2019s go ahead and install our first WordPress instance and take a closer look at what we can do with it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want just a plain WordPress install with nothing fancy, you can do so with the following command. Remember to replace <span style=\"color: #ff0000;\">example.com<\/span> with your own domain or subdomain.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee site create <span style=\"color: #ff0000;\">example.com<\/span> --type=wp<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">However, with EasyEngine you can set up a new WordPress instance together with Let\u2019s Encrypt SSL certificates and Redis Cache enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note that when installing with a Let\u2019s Encrypt, you need to already have your DNS record set to point correctly to your server. A valid domain name is required for Let\u2019s Encrypt to be able to obtain SSL certificates for your website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <span style=\"color: #ff0000;\">example.com<\/span> with your domain or subdomain name.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee site create <span style=\"color: #ff0000;\">example.com<\/span> --type=wp --ssl=le --cache<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When configuring a website with SSL, the installation script will ask for your email address. The email address is used to notify you of important information about your Let\u2019s Encrypt SSL certificate, for example, the certificate\u2019s expiration date.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you\u2019ve entered your email address, the installation will continue. When completed, you will see an output similar to the example below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+--------------------+---------------------------------------+\n| Site               | https:\/\/example.com                   |\n+--------------------+---------------------------------------+\n| Site Root          | \/opt\/easyengine\/sites\/example.com     |\n+--------------------+---------------------------------------+\n| Site Title         | example.com                           |\n+--------------------+---------------------------------------+\n| WordPress Username | vigorous-chaum                        |\n+--------------------+---------------------------------------+\n| WordPress Password | cvlGJlSYXkqG                          |\n+--------------------+---------------------------------------+\n| DB Host            | global-db                             |\n+--------------------+---------------------------------------+\n| DB Name            | example_com                           |\n+--------------------+---------------------------------------+\n| DB User            | example.com-RdqaXV                    |\n+--------------------+---------------------------------------+\n| DB Password        | m09oZe2TvYam                          |\n+--------------------+---------------------------------------+\n| E-Mail             | admin@example.com                     |\n+--------------------+---------------------------------------+\n| SSL                | Enabled                               |\n+--------------------+---------------------------------------+\n| SSL Wildcard       | No                                    |\n+--------------------+---------------------------------------+\n| Cache              | Enabled                               |\n+--------------------+---------------------------------------+<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Browse to the site you just installed and you should see a freshly installed WordPress site with HTTPS enabled.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/easyengine-wp-example.com_.png\" alt=\"EasyEngine WP example.com\" class=\"wp-image-15324\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Afterwards, log in to your WordPress admin panel by going to <span style=\"color: #ff0000;\">https:\/\/example.com\/wp-admin\/<\/span> and use the WordPress user and password as shown in the information provided by your EasyEngine output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can repeat the WordPress site deployment as many times as you want to install multiple websites on the same cloud server. EasyEngine will take care of the background task in order to make the websites accessible. You\u2019ll just need to have the corresponding domains or subdomains pointing to your cloud server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You are then ready to start developing new WordPress sites. If you decided to enable Redis in your installation process, you can see two plugins activated: Nginx Helper and WP Redis. These plugins help you manage the Redis cache straight from your WordPress installation. Nginx Helper clears your cache whenever a post is edited\/published, and WP Redis allows WordPress to utilize Redis cache to its full potential.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other features<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">EasyEngine has a lot of other features you might want to check out. EasyEngine can be used to spin up WordPress instances whenever needed to test something or for developing a new site. Here are some commands you will likely find useful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check and <strong>monitor specific website log files<\/strong>. This can be used to monitor sites in case of errors or abnormalities while troubleshooting issues. Combined with your web browser\u2019s own console it helps a lot to find troublesome issues.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee log show example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Adding HTTP Authentication<\/strong> to your development site. This feature can be used to password-protect websites under development so that nobody finds them by accident.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee auth create example.com --user=username --pass=password<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee auth delete example.com --user=username<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of other commands you will be needing when using EasyEngine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Delete a website<\/strong> when you don\u2019t need it anymore.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee site delete example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Restart all services<\/strong> related to the website.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee site restart example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Display installation information<\/strong> on a specific website.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ee site info example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You may wish to have a look at EasyEngine\u2019s own <a href=\"https:\/\/easyengine.io\/commands\/\" target=\"_blank\" rel=\"noopener\">command documentation<\/a> for more info. Some useful guides can also be found in their <a href=\"https:\/\/easyengine.io\/handbook\/\" target=\"_blank\" rel=\"noopener\">handbook<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">About the Contributor<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Tuomas Lindroos<\/strong><br>Hey, thank you for reading my guide on how to deploy WordPress websites using EasyEngine. I\u2019m the business owner of a company called Tuonetti. We specialize in WordPress website development and in <a rel=\"noopener\" href=\"https:\/\/www.tuonetti.fi\/webhotellit\/\" target=\"_blank\">website hosting<\/a> using UpCloud&#8217;s amazingly fast servers. We are more than happy to help you with any WordPress related issues.<\/p>\n","protected":false},"author":40,"featured_media":15328,"comment_status":"open","ping_status":"closed","template":"","community-category":[223,277],"class_list":["post-2164","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/2164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=2164"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/2164\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=2164"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=2164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}