{"id":146296,"date":"2015-09-18T11:00:23","date_gmt":"2015-09-18T15:00:23","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=146296"},"modified":"2017-02-28T03:23:06","modified_gmt":"2017-02-28T03:23:06","slug":"develop-wordpress-locally-mamp","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/develop-wordpress-locally-mamp\/","title":{"rendered":"How to Develop WordPress Locally with MAMP"},"content":{"rendered":"<p>Sometimes you need to make changes to your WordPress site (like activating plugins or changing the design) that you need\u00a0to test out before you start to mess\u00a0with your live site. The good news is that there is a way to do this \u2013 by making a local version\u00a0of your site for testing and development.<\/p>\n<p>Or maybe you want to start working on a new site but instead of doing all your development on a remote server (i.e. on the Internet), you want to create a development site on your own computer to try things out on. Not only does this keep your development site hidden from the world, it will also speed up your development as you won&#8217;t have to wait for files to upload when you make changes.<\/p>\n<p>In this post, I&#8217;ll show you exactly how to install WordPress locally (i.e. on your computer instead of on the web). I&#8217;ll take you through the process step-by-step with screenshots along the way. Hopefully, once you&#8217;ve read this you won&#8217;t be daunted at all and you&#8217;ll be ready to start using WordPress locally.<\/p>\n<p>You&#8217;ll need to follow a four-part\u00a0process:<\/p>\n<ol>\n<li>Install MAMP on your computer (this applies to Windows and Mac users, as MAMP is no longer restricted to Mac as it once was).<\/li>\n<li>Activate MAMP&#8217;s local servers and change port settings (optional).<\/li>\n<li>Create a database on your computer where your site&#8217;s content will be stored (which means typing one word and\u00a0clicking one button!).<\/li>\n<li>Install WordPress using the famous five-minute install.<\/li>\n<\/ol>\n<p>So let&#8217;s get started!<\/p>\n<h2>Installing MAMP<\/h2>\n<p>First you&#8217;ll need to download the MAMP program. MAMP stands for\u00a0<b>M<\/b>acintosh,\u00a0<b>A<\/b>pache,\u00a0<b>M<\/b>ySQL, and\u00a0<b>P<\/b>HP. This reflects the fact that MAMP was originally developed for use on Macs, but it now runs on Windows and Linux too and is the easiest way to run WordPress locally.<\/p>\n<div  class=\"wpdui-pic-large   \" >\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-1364x1364\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/mamp-large.png\" alt=\"MAMP website\" width=\"1364\" height=\"453\" \/><figcaption class=\"wp-caption-text\">MAMP is free software that lets you run Apache and PHP on your computer, both of which you need to run WordPress locally.<\/figcaption><\/figure>\n<\/div>\n<p>The reason you need MAMP is that it runs PHP (which WordPress is written in), MySQL and Apache on your machine. This means you can\u00a0create and run queries from a database, which is where WordPress stores your content.<\/p>\n<p>Go to the <a href=\"https:\/\/www.mamp.info\/en\/\" target=\"_blank\">MAMP website<\/a>, download the free software and install it on your computer.<\/p>\n<h2>Activating Local Servers with MAMP<\/h2>\n<p>Now that you have MAMP installed you need to start it and get it to run servers on your local machine. This means editing the post settings to one of two options:<\/p>\n<ul>\n<li>Keep the Apache port setting at the default of <strong>8888<\/strong>, which means that when you visit your local site you&#8217;ll have to type the port number in the browser.<\/li>\n<li>Change the Apache port setting to <strong>80<\/strong>, which means you won&#8217;t have to type the post number in the browser but does mean that whenever MAMP launches, it will ask you for your computer&#8217;s password.<\/li>\n<\/ul>\n<p>Which of these you choose makes no difference to how MAMP runs or how your website will run: it&#8217;s just\u00a0a choice between whether you want to keep typing 888 in the browser or you&#8217;d prefer to enter your password. I prefer the second option as I type the website address into my browser more often than I launch MAMP, so I&#8217;m going to change the settings.<\/p>\n<p>But first let&#8217;s launch MAMP.<\/p>\n<h3>Launching MAMP<\/h3>\n<p>Open the MAMP software as you would any program on your computer. You&#8217;ll see the MAMP window:<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/mamp-servers-working1.png\" alt=\"MAMP opening window with servers working\" width=\"735\" height=\"450\" \/><figcaption class=\"wp-caption-text\">Open MAMP and start the servers using this window.<\/figcaption><\/figure>\n<\/div>\n<p>The small boxes\u00a0next to <strong>Apache Server<\/strong> and <strong>MySQL Server<\/strong> should come on and the power icon should turn green. If one or both of the boxes isn&#8217;t filled or the power icon is red, click the <strong>Start Servers<\/strong>\u00a0link (which will be the right-hand link, where it says <strong>Stop Servers<\/strong> in the screenshot).<\/p>\n<p>Now if you&#8217;re happy to keep the ports at their default setting, skip the next step. If you want to change them, read on!<\/p>\n<h3>Editing Port Settings<\/h3>\n<p>To configure the port settings, click the <strong>Preferences<\/strong> link\u00a0to open the preferences window, then\u00a0click on the <strong>Ports<\/strong> tab at the top:<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/mamp-ports-preferences1.png\" alt=\"MAMP ports preferences tab\" width=\"735\" height=\"450\" \/>\n<\/div>\n<p>Edit the <strong>Apache Port<\/strong> field so it says <strong>80<\/strong> (as in the screenshot) and click the OK button. The settings will change and you&#8217;ll be prompted for your computer&#8217;s admin password.<\/p>\n<p>The next step (whether or not you change your port settings) is to create a database for your site.<\/p>\n<h2>Creating a Database<\/h2>\n<p>From the MAMP opening dialog box, click the <strong>Open start page<\/strong> button.<\/p>\n<p>In your browser, the MAMP start page will open:<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/mamp-start-page.png\" alt=\"The MAMP local start page\" width=\"735\" height=\"491\" \/><figcaption class=\"wp-caption-text\">The MAMP start page gives you details of your SQL settings and lets you access the screens for creating a database.<\/figcaption><\/figure>\n<\/div>\n<p>Note that this screen gives you details of your MySQL database settings, which you&#8217;ll need to use later on when you&#8217;re installing WordPress. Don&#8217;t worry about remembering them, though, I&#8217;ll give you those when we get to that step.<\/p>\n<p>Now click the <strong>phpMyAdmin<\/strong> tab at the top of the screen to open the phpMyAdmin module. Once that&#8217;s open, click the <strong>Databases<\/strong> tab at the top of the screen to view the databases screen:<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/phpmyadmin-create-database.png\" alt=\"phpMyAdmin databases screen - creating a new database\" width=\"735\" height=\"299\" \/><figcaption class=\"wp-caption-text\">Use phpMyAdmin to create a database for your WordPress site.<\/figcaption><\/figure>\n<\/div>\n<p>Note that I&#8217;ve already got some databases set up on my local host, which are blurred out in the screenshot. You won&#8217;t see these as yours is a fresh MAMP installation.<\/p>\n<p>Now to create that database. In the <strong>Create database<\/strong> field, type the name of your database. If you&#8217;ll only be running one site locally, you can call the database <strong>WordPress<\/strong>: but if you plan to run more than one local site, it&#8217;s helpful to give the database a name that relates to the site. The database name may need to be shorter than your site name, though, and you can&#8217;t include spaces or punctuation.<\/p>\n<p>After you&#8217;ve typed in the database name, click the <strong>Create<\/strong> button. A database will be created for you.<\/p>\n<p>Were you expecting to create a database to be more complicated? Sorry! Now let&#8217;s get on with installing WordPress.<\/p>\n<h2>Installing WordPress<\/h2>\n<p>Now for the fun part: installing WordPress. If you&#8217;ve installed WordPress manually before on a remote server you&#8217;ll be familiar with this. But if you&#8217;ve always relied on installers, read on!<\/p>\n<h3>Downloading WordPress and Moving it to the MAMP Folder<\/h3>\n<p>First you&#8217;ll need to get hold of a copy of WordPress. Go to the <a href=\"https:\/\/wordpress.org\/download\/\" target=\"_blank\">WordPress download page<\/a> and download a copy of the latest version.<\/p>\n<p>Once you&#8217;ve downloaded the zip file containing WordPress, unzip it and then copy the entire folder to the MAMP\/htdocs folder:<\/p>\n<ul>\n<li>On a Mac, this will be in the <strong>Applications<\/strong> folder, so your WordPress files will be contained within <strong>Applications\/MAMP\/htdocs\/Wordpress<\/strong>.<\/li>\n<li>On a PC, your WordPress files will\u00a0be in <strong>c:\/MAMP\/htdocs\/Wordpress<\/strong>.<\/li>\n<\/ul>\n<p>If you think you&#8217;ll be running more than one local site, change the name of the <strong>WordPress<\/strong>\u00a0folder to something more meaningful, without any spaces.<\/p>\n<p>Now you&#8217;re ready to start the setup process.<\/p>\n<h3>The Famous Five Minute Install<\/h3>\n<p>Open your browser and type <strong>localhost\/WordPress<\/strong> in the URL field at the top of the screen. If you\u00a0opted\u00a0not to\u00a0change your port settings earlier, type <strong>localhost:8888\/wordpress<\/strong>. If you used something other than\u00a0<strong>WordPress<\/strong> as your folder name, type that instead.<\/p>\n<p>You&#8217;ll see the first of the WordPress installation screens, asking you to select the language you want to work in:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-1-language.png\" alt=\"WordPress setup screens: 1 - language\" width=\"735\" height=\"559\" \/> <\/div>\n<p>Select your language and click the <strong>Continue<\/strong> button.<\/p>\n<p>Next you&#8217;ll see a screen telling you what information about your database\u00a0you&#8217;ll need to install WordPress:<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-2-letsgo.png\" alt=\"WordPress setup screens: 2 - information\" width=\"735\" height=\"611\" \/>\n<\/div>\n<p>I&#8217;ll give you this information so you don&#8217;t need to worry! Just click on the <strong>Let&#8217;s go!<\/strong>\u00a0button.<\/p>\n<p>Now comes the screen into which you need to input your database details:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-3-database-details.png\" alt=\"WordPress setup screens: 3 - database details\" width=\"735\" height=\"561\" \/> <\/div>\n<p>Type in the following (as per the screenshot):<\/p>\n<ul>\n<li>Database Name: <strong>WordPress<\/strong> (or whatever name you gave your database when you created it)<\/li>\n<li>User Name: <strong>root<\/strong><\/li>\n<li>Password: <strong>root<\/strong><\/li>\n<li>Database Host: <strong>localhost<\/strong><\/li>\n<li>Table Prefix: <strong>wp_<\/strong><\/li>\n<\/ul>\n<p>You&#8217;ll probably find that most of these fields are pre-populated with the correct settings anyway.<\/p>\n<p>Now click the <strong>Submit<\/strong> button.<\/p>\n<p>The next screen is my favorite &#8211; it tells you that WordPress is talking to your database, which is the most important step:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-4-alright-sparky.png\" alt=\"WordPress setup screens: 4 - database working\" width=\"735\" height=\"307\" \/> <\/div>\n<p>Click on <strong>Run the install<\/strong> to move to the next step.<\/p>\n<p>Next you&#8217;ll see a screen asking you for details of your site:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-5-site-details.png\" alt=\"WordPress setup screens: 5 - site details\" width=\"735\" height=\"616\" \/> <\/div>\n<p>Type in the details for your site as you normally would when installing WordPress on your web\u00a0host. WordPress will encourage you to use a strong password, although that is less of an issue when working locally. You may as well uncheck the <strong>Privacy<\/strong> box, as Google won&#8217;t be able to access your local site anyway &#8211; but if you copy the site to a remote host later, remember to change that setting in the admin screens.<\/p>\n<p>Finally, click on <strong>Install WordPress<\/strong>.<\/p>\n<p>You&#8217;ll now see a success screen &#8211; great stuff!<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-6-success.png\" alt=\"WordPress setup screens: 6 - success\" width=\"735\" height=\"417\" \/> <\/div>\n<p>Click on the <strong>Log in<\/strong> button to access your site:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/09\/worpress-install-7-login.png\" alt=\"WordPress setup screens: 7 - login\" width=\"735\" height=\"417\" \/> <\/div>\n<p>Now simply log in to your site as you normally would. You&#8217;ll be taken to the WordPress dashboard for your new site from where you can add content, install plugins and themes, and everything else you&#8217;d expect on a remote WordPress site.<\/p>\n<p>All done! You&#8217;ve installed WordPress on your local machine. Now you can use it to create a new development site or to import\u00a0content from your remote site and test it safely.<\/p>\n<h2>Summary<\/h2>\n<p>Hopefully, now that you&#8217;ve read this post (and maybe followed along) you won&#8217;t find the task of creating a WordPress site locally quite so daunting. With the MAMP software, it&#8217;s straightforward to run local servers, create a database and then install WordPress.<\/p>\n<p>Now you can use your new site to develop new ideas or test plugins and themes before using them on your love site. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to set up WordPress locally on your computer? This step-by-step guide walks you through how to develop your WordPress sites using MAMP.<\/p>\n","protected":false},"author":347011,"featured_media":146411,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[10244],"tutorials_categories":[],"class_list":["post-146296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-localhost"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/146296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/347011"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=146296"}],"version-history":[{"count":21,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/146296\/revisions"}],"predecessor-version":[{"id":218995,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/146296\/revisions\/218995"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/146411"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=146296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=146296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=146296"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=146296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}