5 steps to installing WordPress with MAMP and WP-CLI

This will grab all the current WordPress files from the github WordPress repo, extract them and put them inside your site project folder. This is a huge time saver as it can install WordPress in seconds (with a fast internet connection)

Step One – Create Your WordPress Project folder

Inside your MAMP server root (I like to set my MAMP server root to be ~/Sites) create a folder that will hold your WordPress project.

$ mkdir ~/Sites/my-wordpress-project

Step Two – Pull down latest WordPress copy

$ wp core download

So now you are ready to create your wp-config.php file

Step Three – Create wp-config.php file

$ wp core config --dbuser=root --dbpass=root --dbname=my_wordpress_project

This will create the file to connect you to your MySQL databse. The above code is assuming you used MAMP and the default username and password for MAMP is root and root. Change the --dbname value to match your database name. I recommend using snake case to name your database this_is_snake_case

important Make sure you remember this is the name of your database. It needs to exactly match your database name that you will create in the next step.

Step Four – Create your empty database

Open phpMyAdmin and create a database making sure your database matches the name you used in the previous step (In my example I used my_wordpress_project so I would created a database with that name. Substitute your database name for my database name)

Step Five – Populate your database

With the default WordPress tables and content

$  wp core install --url=http://localhost/my-wordpress-project --title=MyWordPressProject --admin_user=admin --admin_password=password --admin_email=myemail@gmail.com

important – Many people make mistakes at this point. This is what to watch out for to ensure you don’t make the same mistakes

  • Make sure your port is correct
    • Did you use an Apache port of 8888 (default MAMP port) or did you change your MAMP port to be 80? If you used 8888 as your port your wp-cli command should be:
wp core install --url=http://localhost:8888/my-wordpress-project --title=MyWordPressProject --admin_user=admin --admin_password=password --admin_email=myemail@gmail.com
  • Is the email correct? That email should be an email that you can use because this email is the admin email of the site and any problems (like getting locked out of WordPress) get resets sent to this email

  • Is the URL correct? What is the name of your folder your project is in? Does it match the URL in your wp-cli command --url=http://localhost:8888/my-wordpress-project? If it doesn’t your site won’t work and you’ll have to redo everything from the start or do a find and replace in the exported SQL form your database.

  • If you get a can’t connect to database use which php and which mysql in your terminal to find out if your MAC OS knows about the MAMP php and MAMP mysql. If you don’t see MAMP in what is returned from these commands, your path needs to be updated with something like this in your ~/.bash_profile


# The following MAMP export stuff is needed when you work with WP-CLI
# Use MAMP version of PHP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
export PATH="/Applications/MAMP/Library/bin:$PATH"

Update your ~/.bash_profile with $ source ~/.bash_profile and you now should see the MAMP string somewhere in the output from $ which php and $ which mysql

Make sure you turn debugging on

This will help you track down errors in WordPress. By default all error notices are turned off in WordPress so if problems arise you will only see a white screen commonly referred to as the white screen of death. Turning this option on in wp-config.php will prevent the white screen of death from ruining your day.


// Set to false when in Production
define( 'WP_DEBUG', true );

Happy coding!

SSL Instructions on shared GoDaddy server with a WordPress Site

important You must renew Let’s Encrypt SSL certificates every 90 days, otherwise, the certificate will expire and your website will generate errors

Let’s Encrypt offers free SSL certificates. If you have a root access on your server with Godaddy, the SSL instructions are a lot easier. Shared hosts on Godaddy do not have root access.

Here is a 20-minute video that will get you 90% of the way

The sound quality is poor and the presenter’s English is hard to understand at times but it is an excellent video and many thanks to Nadil for taking the time to explain a tricky process.

Review of the video steps

Go to this site: gethttpsforfree.com

This site will help you install your free SSH

Step 1: Account Info

  • Enter your email under Account Email
  • Click (how do I generate this?)

Keep this tab open as we’ll return to it soon.

Enable SSH on Godaddy cpanel

Open another tab and browse to Godaddy and log into your cpanel

ssh access

Log into Godaddy cpanel and enable SSH
* Search for SSH, click it and click Enable
* Click Manage SSH Keys

Manage SSH Keys

  • Import SSH Key on a mac for Godaddy. If this is your first time I like to use the Github SSH documentation page to show me how to create a SSH key and then copy it to Github. Follow the same instructions for Godaddy by taking the id_dsa SSH Key and pasting it into the public key box. If you add a passphrase it makes it more secure but then you have to enter that passphrase every time you log in via SSH.
  • Click Import Key

Import Key

  • Then once you add the key you need to click ‘Manage’ and ‘Authorize’ to make the key live. That’s it.

Manage Public Keys

You now should be able to SSH into your box with $ ssh username@ (substitute your own username and IP address) and you will have access to your box

Open Terminal on Mac

And SSH into your Godaddy shared server with $ ssh username@ (substitute your own username and IP address)

Once you see you have connected to your server, see what files are in the home directory (the default directory that opens when you log into your server)

$ ls (shows you all the files in the current directory)

Return to https://gethttpsforfree.com/ tab

Generate a new account keypair with openssl

In remote Terminal (from now on if you see $ that means type it in the Terminal)

$ openssl genrsa 4096 > account.key

Print your public key

In remote Terminal

$ openssl rsa -in account.key -pubout

That will output a key. Copy the key from begin to end (something like this):

-----END PUBLIC KEY-----

Paste that key into Account Public Key

Click Validate Account Info button to make sure it tells you to proceed to step 2

Step 2: Certificate Signing Request

On Godaddy tab, since we have no root access we need to use the cpanel and find SSL/TLS tab


Click certificate signing request (CSR)


Enter values in the following fields

  • Domains: example.dev
  • City: your city
  • State: your state
  • Country: your country
  • Company: Your company (no company? make one up)

The above are required. The other fields are optional

Click Generate

Copy Encoded Certificate Signing Request

Something like this: (Begin to End)


Return to the Get HTTPS for free tab

And paste the code you saved to your clipboard to the Certificate Signing Request:

Step 2: Cert Signing Request

Click Validate CSR to see if you can proceed to Step 3

Step 3: Sign API Requests

You copy one PRIV_KEY... at a time and paste them into your terminal
It will spit back a value starting with (stdin)= Copy that value to the end and paste it in the field below (on the gethttpsforfree.com tab).

Do this for all 3 fields and then click Validate Signatures to see if you can move on to Step 4

If this doesn’t make sense start watching the video at 08:33

Step 4: (09:42) Verify Ownership

Copy the PRIV_KEY into your terminal. Then hit return and copy the content the terminal returns (from stdin)= to the end) and paste back into the gethttpsforfree.com tab

Click Option 2 - file-based

It tells you to create a file with a crazy long name inside your the root of your WordPress site (something like http://yourdomain.com/.well-known/acme-challenge/hagaDohcwTLgIv2rz7Fn-tT_ioLeMmwUJUdn2jabcd)

So navigate to the root of your WordPress site on your Godaddy shared server and:

$ mkdir .well-known

Then change into that directory

$ cd .well-known

Then make the acme-challenge folder inside that folder

$ mkdir acme-challenge

Then change into that directory

$ cd acme-challenge

Then create a file with the name at the end of the URL in step 4 (something like http://yoursite.com/.well-known/acme-challenge/hagaDohcwTLgIv2rz7Fn-tT_ioLeMmwUJUdn2jabcd)

So create this file (name it based on your URL)

$ touch hagaDohcwTLgIv2rz7Fn-tT_ioLeMmwUJUdn2jabcd

Then open that file in your vim editor

$ vi hagaDohcwTLgIv2rz7Fn-tT_ioLeMmwUJUdn2jabcd

Type i to enter insert mode so you can type inside the editor and paste the content inside the Serve this content in Step 4

Once you paste that content into the file. Save and quit out of the Vim editor with:

His esc key. Then type :wq!

That will switch you to command mode (esc)
The :wq! (will write + quit + force)

To test if the file path is correct paste your URL from Step 4 inside the browser and hit return


You should see the content from that file in the browser.

Then click I'm now serving this file on yoursite.com button

See if it tells you to got to Step 5

You should see two certificates output in Step 5.

Copy to the clipboard your Signed Certificate from Step 5

Should look something like:


In Godaddy tab

Scroll to bottom of page and click Return to SSL Manager

Click Certificates (CRT)

Paste your code in the box under ‘Upload a New Certificate’

Click Save Certificate

Click Go Back link

Scroll down to the bottom and click the Return to SSL Manager link

Click Install and Manage SSL for your site (HTTPS)

Select a domain from the Domain dropdown
Paste the Certifcate again in the CRT box
Check to make sure below the box you Domains are correct, that Let’s Encrypt is the Issuer
Then click ‘Autofill by Certificate’
Make sure Enable SNI for Mail Services is checked (will be checked by default)
Click Install Certificate

Should tell you are successful

Click Ok

Test your install

Go back to Gethttpsforfree tab and click Test my install button

That will take you to www.ssllabs and check your site automatically. It will take about 5 minutes and then it will grade your certificate.

If all is good you should have an A Overall Rating


If using VVV and WordMove

You need to make sure your domains match up in your ‘MoveFile’

Make sure local, staging and production have been changed from http:// to https://

Set up SSL locally on VVV/Vagrant WordPress site

Setting SSL locally using VVV is different. Here is a tutorial on doing that.

Here is a link to setting SSL locally with MAMP

In the WordPress Dashboard

Settings > General

Make sure to change WordPress Address (URL) to https://yourdomain.com

And change Site Address (URL) to http://yourdomain.com

Then click Save Changes

Test your site on Why No Padlock

Just copy and paste your site URL (any page of your site) and it will tell you why you don’t have a padlock.

The bottom line is you need to make sure all your links have https:// in them instead of http://. A good trick is to use relative URLs (read this article from CSS-Tricks to learn more) and here is another good article But they both are old articles and do not mention that you can now get free SSL certs from Let’s Encrypt.

Fixing issues

After you convert to SSL you will run into some problems

Some WordPress plugins can help speed up your issues:

WordPress HTTPS (SSL)
This program came recommended but after installing I saw it hadn’t been updated in 2 years. I was getting errors in my Terminal when I installed and activated it with WP-CLI. The great thing it did was immediately add SSL to the admin side. But you can easily do this by adding this to


define('FORCE_SSL_ADMIN', true);

But the errors the plugin was generating got on my nerves and I found another plugin called SSL Insecure Content Fixer

SSL Insecure Content Fixer

This plugin worked really well and fixed most of my mixed content SSL errors.

relative URLS

A superior way to do this is to use relative users with //

Test Query with WP-CLI:

$ wp search-replace ‘http://yoursite.net’ ‘https://yoursite.net’ -–skip-columns=guid -–dry-run

Then remove the dry run :

$ wp search-replace ‘http://yoursite.net’ ‘https://yoursite.net’ -–skip-columns=guid

How to install WordPress using MAMP

The traditional, long way (Use WP-CLI for the fast short way)

  • Download WordPress
  • Extract and rename wordpress folder after your project
    • Follow my rules of
      • Files and folder lowercase (file.jpg of some-folder)
      • No spaces, use dashes for multiple words (file-name.jpg or folder-name)
      • Only use underscores (_) when naming a database
      • Extracted the zip or compressed file
      • Delete zip file for good computer house cleaning
  • Change MAMP settings. By default the port is 8888. Change the port to 80

screenshot of MAMP settings for port

  • Change the Document root to Sites
    • This is an exception to the folder name rule because this used to be an out of the box feature of IOS but they removed it with recent IOS systems. I name it with a capital letter out of tradition.

screenshot of Sites Document Root

  • Note Stop and start MAMP servers
    • Mac IOS will ask you to enter your password to stop and start servers
    • You will know if it is working if you when you click on ‘Open WebStart page’ you see a path of http://localhost and not http://localhost:8888
  • Use phpMyAdmin to create a new empty database
    • Use lowercase only and if multiple words use underscores
    • Name the database without saying db or database in name (for better security)
  • Place your new, extracted, renamed WordPress folder inside your new Sites folder
  • If you browse to http://localhost you should now see your new WordPress project
    • Click project and you will now walk through browser pages to install wordpress

Page 1

choose language

Page 2

Tells you that you are about to populate your database with the WordPress tables.

Click the Let's go! button


Page 3

This is your database connection info. When you enter this, WordPress will be able to connect to your database and populate the database you just created with the WordPress database tables. It will also create a wp-config.php file and put your database info in that file. This file is important to keep safe because if someone gets a hold of it, they can access and delete your database. The MAMP default username is root and the default password is root. This is fine for local development but when deploying to production you obviously want a more secure user name and password. In production your Database Host is usually localhost but some hosts use a different URL. They will let you know if they do in their cpanel. It is also a good security practice to rename the Table prefix to something other than wp_. Click Submit button when your Database info is correctly entered.

screenshot of WordPress sample database info

If you get an error

error database page

You’ll get this is you typed any of the info incorrectly. It’s a good idea to write down and store all your connection information in a safe place. Click Try again to take another stab at putting in the correct info.

Page 4

run install

If all is well, you’ll get this. Click Run the install.

Page 5

This will start to add info to specific WordPress database tables. Put your Site Title in (great SEO boost right out of the gate). Enter a username (Never use admin as the password as most hackers try that first because most people use it.). For local development you can put an easy password like password as you are the only one that has access to this. But when you put it live, you obviously want a better password. It should be noted that the username and password here are to enable you to login to the WordPress Admin Dashboard with Admin privlidges.

Check confirm use of weak password checkbox if you use a weak password.

Enter your email. This is important if you ever forget your password as WordPress will send you an email when you request to reset your password.

When working locally or on a staging server, you obviously don’t want SEO engines to see your site so check Discourage search engines from indexing this site. Make sure to uncheck it when in production or else your site will be invisible to all search engines which is obviously bad for business.

page 5 screenshot.

Finally, click Install WordPress.

Page 6

If all goes well you will see:

will see this page.

If not, troubleshoot and try and find the error of your ways. Click the Log In button.

Page 7

You will see this page.

Use your login credentials to login to the admin Dashboard.

To login in the future go to http://localhost/your-wordpress-site/wp-admin