{"id":3906,"date":"2018-10-25T14:14:11","date_gmt":"2018-10-25T14:14:11","guid":{"rendered":"https:\/\/cloudkul.com\/blog\/?p=3906"},"modified":"2018-10-29T05:53:44","modified_gmt":"2018-10-29T05:53:44","slug":"install-wordpress-on-ubuntu-google-cloud-gcp","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/","title":{"rendered":"Install WordPress on Google Cloud"},"content":{"rendered":"<h2>Introduction:<\/h2>\n<p>&nbsp;<\/p>\n<p>Here, in this blog, we will discuss about installing WordPress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL. For installing it on GCP, you need to have a registered GCP account. First you need to setup a LAMP server to create the required environment for installation.<\/p>\n<p>&nbsp;<\/p>\n<h2>Create a VM on GCP and Setup LAMP server:<\/h2>\n<p>&nbsp;<\/p>\n<p>For installing wordpress on GCP, we need to first create a Linux VM on GCP and setup a LAMP server.<\/p>\n<p>In this blog we will use the following configurations:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>OS: Ubuntu 16.04<\/li>\n<li>Database: MySQL 5.7<\/li>\n<li>PHP: php v7.0<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>First, we need to create a Compute Engine VM on GCP along with a MySQL database on SQL service of GCP. Then you need to setup LAMP server on it for installing wordpress. You can follow my blog for the steps for <a href=\"https:\/\/cloudkul.com\/blog\/running-compute-engine-vm-on-google-cloud\/\">creating a Compute engine VM<\/a> and <a href=\"https:\/\/cloudkul.com\/blog\/lamp-installation-on-google-cloud\/\">setting up a LAMP server<\/a> on GCP.<\/p>\n<p>&nbsp;<\/p>\n<h2>Download WordPress:<\/h2>\n<p>&nbsp;<\/p>\n<p>Download the latest source code as shown below.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">curl -O https:\/\/wordpress.org\/latest.tar.gz\r\nsudo tar xzf latest.tar.gz -C \/var\/www\r\nrm -f latest.tar.gz<\/pre>\n<p>&nbsp;<\/p>\n<h2>Configure Apache:<\/h2>\n<p>&nbsp;<\/p>\n<p>Configure the Apache with the below configuration. If you need to run the wordpress on a domain , uncomment the ServerName and ServerAlias section and update your domain name. Else you can leave it as it is.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"crayon-pre\">\n<div id=\"crayon-5bd19336cdb34999232360-1\" class=\"crayon-line\">\n<pre class=\"lang:default decode:true\">sudo vim \/etc\/apache2\/sites-enabled\/000-default.conf<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<div>\n<div class=\"crayon-pre\">\n<pre class=\"lang:default decode:true\">&lt;VirtualHost *:80&gt;\r\n\r\n#ServerName mydomain.com\r\n#ServerAlias www.mydomain.com\r\nDocumentRoot \/var\/www\/wordpress\r\n\r\n&lt;Directory \/var\/www\/wordpress&gt;\r\nOptions Indexes FollowSymLinks MultiViews\r\nRequire all granted\r\nAllowOverride all\r\n&lt;\/Directory&gt;\r\n\r\nErrorLog \/var\/log\/apache2\/error.log\r\nCustomLog \/var\/log\/apache2\/access.log combined\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Restart Apache server.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">sudo service apache2 restart<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<div>\n<h2>Create a MySQL Database and User:<\/h2>\n<p>&nbsp;<\/p>\n<p>Login to your MySQL server and create a user and database for your wordpress application. Change the database name, database user and password as per your need.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">mysql -h &lt;mysql-instance-public-ip&gt; -u root -p<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">&gt; CREATE DATABASE wordpress;\r\n&gt; CREATE USER 'wp_user'@'%' IDENTIFIED BY 'user_pwd';\r\n&gt; GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'%';\r\n&gt; FLUSH PRIVILEGES;\r\n&gt; exit<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>Configure WordPress:<\/h2>\n<div>\n<p>&nbsp;<\/p>\n<p>Create a wp-config.php file on the document root from the sample configuration file.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<pre class=\"lang:default decode:true\">cd \/var\/www\/wordpress\/\r\nsudo cp wp-config-sample.php wp-config.php<\/pre>\n<p>&nbsp;<\/p>\n<p>Update the database details in the wp-config.php file.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">vim wp-config.php<\/pre>\n<p>&nbsp;<\/p>\n<p>Update the details of the below lines in the file.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">\/** The name of the database for WordPress *\/\r\ndefine('DB_NAME', 'database_name_here');\r\n\/** MySQL database username *\/\r\ndefine('DB_USER', 'username_here');\r\n\/** MySQL database password *\/\r\ndefine('DB_PASSWORD', 'password_here');\r\n\/** MySQL hostname *\/\r\ndefine('DB_HOST', 'localhost');<\/pre>\n<p>&nbsp;<\/p>\n<p>Also update the unique phrase in the wp-config.php file to secure the installation. Find and update the &#8220;unique phrase&#8221; in the file. You can simply generate it and copy paste to update it from<a href=\"https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/\"> here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">define('AUTH_KEY', 'put your unique phrase here');\r\ndefine('SECURE_AUTH_KEY', 'put your unique phrase here');\r\ndefine('LOGGED_IN_KEY', 'put your unique phrase here');\r\ndefine('NONCE_KEY', 'put your unique phrase here');\r\ndefine('AUTH_SALT', 'put your unique phrase here');\r\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\r\ndefine('LOGGED_IN_SALT', 'put your unique phrase here');\r\ndefine('NONCE_SALT', 'put your unique phrase here');\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>You can also use curl command using terminal like:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">curl -s https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<\/pre>\n<p>&nbsp;<\/p>\n<div>Set appropriate apache permission to the files and directories.<\/div>\n<div><\/div>\n<div>\n<pre class=\"lang:default decode:true\">sudo chown -R www-data:www-data \/var\/www\/wordpress<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>Installing WordPress:<\/h2>\n<p>&nbsp;<\/p>\n<p>To install, enter the IP of the GCP VM in the web browser and hit enter. An installation page will be displayed\u00a0 as below:<\/p>\n<p>&nbsp;<\/p>\n<div><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3923\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp1.png\" alt=\"\" width=\"701\" height=\"555\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Select your preferred language and click on continue. On the next page you need to provide the information like Site title, username and password and email ID.\u00a0 Note the username and password as you will need it late to login.<\/p>\n<p>&nbsp;<\/p>\n<div><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3924\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp2.png\" alt=\"\" width=\"639\" height=\"603\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Provide the necessary information and click on install wordpress. On the next page, you will see a success message with the username that you entered in the previous page. Click on the login button to login to the wordpress admin. On the admin login page, enter the username and password and the admin dashboard page will be displayed as below.<\/p>\n<p>&nbsp;<\/p>\n<div><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3925\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp3.png\" alt=\"\" width=\"953\" height=\"574\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Congrats, your wordpress site is now installed and you can start exploring it.<\/p>\n<p>&nbsp;<\/p>\n<div>\n<p>Stay Connected!<\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>In case of any help or query, please\u00a0<a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\" rel=\"noopener noreferrer\">contact us<\/a><\/em><em> or raise a ticket at <a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.<\/em><em><br \/>\n<\/em><\/strong><\/p>\n<\/div>\n<div><\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: &nbsp; Here, in this blog, we will discuss about installing WordPress on Google Cloud <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,87,86,21,1],"tags":[203],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Install Wordpress on Google Cloud - Cloudkul<\/title>\n<meta name=\"description\" content=\"Here, in this blog, we will discuss about installing Wordpress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Wordpress on Google Cloud - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Here, in this blog, we will discuss about installing Wordpress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-25T14:14:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-29T05:53:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp1.png\" \/>\n<meta name=\"author\" content=\"Kamal Verma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/\",\"name\":\"Install Wordpress on Google Cloud - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2018-10-25T14:14:11+00:00\",\"dateModified\":\"2018-10-29T05:53:44+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051\"},\"description\":\"Here, in this blog, we will discuss about installing Wordpress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install WordPress on Google Cloud\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051\",\"name\":\"Kamal Verma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Kamal Verma\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/kamaldev-cloudkul308\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Wordpress on Google Cloud - Cloudkul","description":"Here, in this blog, we will discuss about installing Wordpress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL.","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:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/","og_locale":"en_US","og_type":"article","og_title":"Install Wordpress on Google Cloud - Cloudkul","og_description":"Here, in this blog, we will discuss about installing Wordpress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL.","og_url":"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/","og_site_name":"Cloudkul","article_published_time":"2018-10-25T14:14:11+00:00","article_modified_time":"2018-10-29T05:53:44+00:00","og_image":[{"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/wp1.png"}],"author":"Kamal Verma","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/","url":"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/","name":"Install Wordpress on Google Cloud - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2018-10-25T14:14:11+00:00","dateModified":"2018-10-29T05:53:44+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051"},"description":"Here, in this blog, we will discuss about installing Wordpress on Google Cloud Platform(GCP). WordPress is a free and open-source content management system based on PHP and MySQL.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/install-wordpress-on-ubuntu-google-cloud-gcp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Install WordPress on Google Cloud"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051","name":"Kamal Verma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Kamal Verma"},"url":"https:\/\/cloudkul.com\/blog\/author\/kamaldev-cloudkul308\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3906"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=3906"}],"version-history":[{"count":21,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3906\/revisions"}],"predecessor-version":[{"id":3932,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3906\/revisions\/3932"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=3906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=3906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=3906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}