{"id":2019,"date":"2016-06-17T18:31:47","date_gmt":"2016-06-17T22:31:47","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2019"},"modified":"2017-10-10T12:43:18","modified_gmt":"2017-10-10T16:43:18","slug":"install-wordpress-ubuntu-16","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/","title":{"rendered":"How to Install WordPress on Ubuntu 16"},"content":{"rendered":"<p><span class=\"s1\">WordPress (WP) is ubiquitous in the hosting world and with thousands of plug-ins and customization, it pretty much allows you to do anything you want.\u2002\u2002It is not only easy to use but easy to install as well.\u2002\u2002By the end of this tutorial you will have your own Ubuntu server running WP.<\/span><\/p>\n<h2>Getting Started<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) with Ubuntu 16.04 and a LAMP setup previously installed.<\/p>\n<p>If you need to learn <a href=\"https:\/\/www.globo.tech\/learning-center\/how-to-setup-a-basic-lamp-linux-apache-mysql-and-php-on-ubuntu\/\">how to install LAMP on Ubuntu 16<\/a> visit our tutorial on it. Because of Ubuntu 16, PHP7 is now the standard version and is reflected in this tutorial.<\/p>\n<p><code class=\"gris\">If you don't want to go through the whole installation of WordPress on your CentOS 7 server, you can always try our <a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">One-Click Apps<\/a> and get a new WordPress in seconds. <\/code><\/p>\n<h2>Let&#8217;s Start with MySQL<\/h2>\n<p>First we&#8217;ll create WordPress&#8217; database. In these examples we&#8217;ll use &#8220;wordpress&#8221; as the database name, &#8220;wpuser&#8221; for the user and &#8220;wppassword&#8221; as the password. We recommend that you\u00a0change the username and password to something unique and strong. \u00a0We will need to\u00a0access MySQL\u00a0with your database root credentials:<\/p>\n<p><code>mysql -u root -p<\/code><\/p>\n<p>Now, create the database where your WP will store its content.<\/p>\n<p><code>CREATE DATABASE wordpress; <\/code><\/p>\n<p>We now need a user and password for the database. These credentials are for MySQL\u00a0only, and are not how you will access your site in later steps.<\/p>\n<p><code>CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'wppassword'; <\/code><\/p>\n<p>The created credentials now need the privileges necessary to update the database. We&#8217;ll assign those here.<br \/>\n<code>GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost'; <\/code><\/p>\n<p>We&#8217;ve created the privileges, but they must now be confirmed and saved to the database in order to take effect.<br \/>\n<code> FLUSH PRIVILEGES; <\/code><\/p>\n<p>Great, you&#8217;ve successfully set up the database. Let&#8217;s exit MySQL and begin setting up WordPress&#8217; PHP scripts.<br \/>\n<code>exit<\/code><\/p>\n<h2>Installing WordPress<\/h2>\n<p>We will start\u00a0by downloading the latest WordPress packages which ensure you will have the latest code, security updates or goodies.\u00a0Fortunately, the latest download is stored at a permanent URL that is easy to retrieve.<\/p>\n<p><code> cd \/root<br \/>\nwget http:\/\/wordpress.org\/latest.tar.gz<\/code><\/p>\n<p>When complete, we can unzip the file. This will create a directory in which we&#8217;ll need to perform a few steps.<\/p>\n<p><code> tar -zxvf latest.tar.gz<\/code><\/p>\n<p>WordPress requires\u00a0some extra PHP modules to be install\u00a0on your ubuntu 16 server. Let&#8217;s install and activate them.<\/p>\n<p><code> apt-get install php-gd php-ssh2 -y <\/code><\/p>\n<p>All necessary PHP modules are now available and active. We will need to restart Apache to apply the changes.<\/p>\n<p><code> systemctl restart httpd.service<\/code><\/p>\n<p>We&#8217;re now ready to start setting up WordPress&#8217; scripts to run under Apache. Let&#8217;s place them in Apache&#8217;s document root so it knows where to find them.<\/p>\n<p><code> cd wordpress<br \/>\ncp * -R \/var\/www\/html\/<\/code><\/p>\n<p>Next we need an uploads directory, where any content uploaded by users and administrators is stored.<\/p>\n<p><code> mkdir \/var\/www\/html\/wp-content\/uploads<br \/>\nchmod 775 \/var\/www\/html\/wp-content\/uploads<\/code><\/p>\n<p>Make sure to give\u00a0\u00a0Apache permission to read and write to its document root. This will enable plugin installation and upgrades.<\/p>\n<p><code> chown -R apache. \/var\/www\/html\/*<\/code><\/p>\n<p>The WP files are now in place, so next we&#8217;ll need to tell it how to connect to the database. We&#8217;ll do that by entering the root directory.<\/p>\n<p><code> cd \/var\/www\/html\/<\/code><\/p>\n<p>Take a backup of the default configuration in case you make any mistakes.<\/p>\n<p><code> cp wp-config-sample.php wp-config.php<\/code><\/p>\n<p>It&#8217;s now time to set the database credentials. Do so by editing the wp-config.php file, replacing &#8220;wpuser&#8221; and &#8220;wppassword&#8221; with the database user and password set up in previous steps.<\/p>\n<p><code> nano wp-config.php<\/code><\/p>\n<p>Edit the file as following:<br \/>\n<code class=\"gris\">\/\/ ** MySQL settings - You can get this info from your web host ** \/\/<br \/>\n\/** The name of the database for WordPress *\/<br \/>\ndefine('DB_NAME', 'wordpress');<br \/>\n\/** MySQL database username *\/<br \/>\ndefine('DB_USER', 'wpuser');<br \/>\n\/** MySQL database password *\/<br \/>\ndefine('DB_PASSWORD', 'wppassword'); <\/code><\/p>\n<p>Save the file. You&#8217;ve just recorded database access credentials in a file that can be accessed over the web. To prevent that, let&#8217;s edit the .htaccess file to block this plus a few other common attacks.<\/p>\n<p><code>nano \/var\/www\/html\/.htaccess<\/code><\/p>\n<p>Edit the file as following:<br \/>\n<code class=\"gris\"># BEGIN WordPress<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/<br \/>\nRewriteRule ^index\\.php$ - [L]<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/index.php [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n# END WordPress<\/code><\/p>\n<p>We&#8217;re almost done. Save the file, and continue the installation by accessing the web-based installer. Visit http:\/\/your_main_ip to start the process.<\/p>\n<p>First, select your default language. Next, set a site title. Set an administrative username, a strong password and enter your email address. Don&#8217;t choose usernames like &#8220;admin,&#8221; &#8220;webmaster&#8221; or &#8220;root&#8221; that an attacker might guess. <\/p>\n<p><code class=\"rouge\">Always be sure to use a strong password.<\/code><\/p>\n<p>You can now access your site with the username and password you just entered. Simply visit http:\/\/your_main_ip and start adding content!<\/p>\n<h2>Conclusion<\/h2>\n<p>You are now running WordPress on the latest LTS version of Ubuntu! Make sure to upkeep your server and your WP in the future and you will be able to enjoy all the current and new WordPress. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>WordPress (WP) is ubiquitous in the hosting world and with thousands of plug-ins and customization, it pretty much allows you to do anything you want.\u2002\u2002It is not only easy to use but easy to install as well.\u2002\u2002By the end of this tutorial you will have your own Ubuntu server running WP. Getting Started To complete<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":2031,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-2019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-hosting","operating_system-ubuntu-16-04","applications-wordpress2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Wordpress on Ubuntu 16 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will walk you through the installation of the content management system Wordpress on your Ubuntu 16.04 LTS server. Read now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Wordpress on Ubuntu 16 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will walk you through the installation of the content management system Wordpress on your Ubuntu 16.04 LTS server. Read now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-17T22:31:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-10-10T16:43:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"333\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/\",\"name\":\"How to Install Wordpress on Ubuntu 16 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png\",\"datePublished\":\"2016-06-17T22:31:47+00:00\",\"dateModified\":\"2017-10-10T16:43:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will walk you through the installation of the content management system Wordpress on your Ubuntu 16.04 LTS server. Read now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png\",\"width\":500,\"height\":333,\"caption\":\"Wordpress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install WordPress on Ubuntu 16\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Wordpress on Ubuntu 16 - Globo.Tech","description":"This tutorial will walk you through the installation of the content management system Wordpress on your Ubuntu 16.04 LTS server. Read now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Wordpress on Ubuntu 16 - Globo.Tech","og_description":"This tutorial will walk you through the installation of the content management system Wordpress on your Ubuntu 16.04 LTS server. Read now!","og_url":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/","og_site_name":"Globo.Tech","article_published_time":"2016-06-17T22:31:47+00:00","article_modified_time":"2017-10-10T16:43:18+00:00","og_image":[{"width":500,"height":333,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/","url":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/","name":"How to Install Wordpress on Ubuntu 16 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png","datePublished":"2016-06-17T22:31:47+00:00","dateModified":"2017-10-10T16:43:18+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will walk you through the installation of the content management system Wordpress on your Ubuntu 16.04 LTS server. Read now!","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Wordpress1.png","width":500,"height":333,"caption":"Wordpress"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/install-wordpress-ubuntu-16\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Install WordPress on Ubuntu 16"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2019"}],"version-history":[{"count":13,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2019\/revisions"}],"predecessor-version":[{"id":2827,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2019\/revisions\/2827"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/2031"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}