If you’re getting started with WordPress or needing to test out themes, plug-ins or code, doing a local install is the best way to practice and test without worrying about altering your live site. Or if you want to work on WordPress sites when you don’t have internet access (you’ll need to download 2 things first).
Setting up a local install is free and fairly easy. After you do this a couple of times you’ll be looking to local test almost everything before changing the live website.
First download: https://www.mamp.info you’ll only need the basic free version, it contains everything you need to do a local install click ‘free download’. You’ll get both the Pro and free version, the free version might be inside the MAMP folder, make a shortcut of this one so you don’t open the Pro version.
After installing MAMP select a folder you want to be for your website testing, you’ll want to create a folder with a web friendly name like ‘test_sites’. This will be the folder you’ll hold your site tests; you can have as many as you like. If it doesn’t ask you where you want to save you can select it by going into:
Preferences > Web Server; at Document Root click ‘Select’ and choose the folder you want to use.
If you use a folder with spaces or special characters you’ll have to work around them or could have issues. For example, if the folder has spaces you’ll have to have ‘%20’ where the spaces are, this is the HTML code for a space.
Next download WordPress from wordpress.org; save to your test folder and unzip. Rename the unzipped folder to what you want to call your site remember to either remove spaces or add ‘_’ between names. For testing you can call it ‘test’. After downloading WordPress you no longer need to have internet access, unless you’re need to download themes or plug-ins. The MAMP will act as your local network for the testing.
Database setup:
Instructions and more information on the database from WordPress: https://wordpress.org/support/article/creating-database-for-wordpress/#using-phpmyadmin
Now you’ll need to setup the database, super easy, that WordPress will connect to. With MAMP started and on the ‘WebStart page’ if not showing, in the MAMP app you can click the ‘Open WebStart page’. On the Webstart page click on:
TOOLS > PHPMYADMIN
This will take you to the database(s) page; click on the tab marked ‘Databases’.
At the top of this new screen you’ll see ‘Create database’ the type should be ‘utf8_general_ci’ if not select it from the dropdown. Put in the name you want, such as ‘testdb’ for your site, using no spaces or special symbols. Click ‘Create’ to have your new database keep the database name you’ll need this when installing WordPress.
If you’re just testing locally you can keep as is with using the user and password as ‘root’.
If you’re going to production you’ll want to create another user and have a secure password and remove ‘root’ from access. This user can be added under ‘User accounts’ this will depend on the program you’re using to migrate your site and the hosting plan, most hosting will not allow ‘root’.
I’ll be writing this as you are learning WordPress locally and not deploying to a server.
Setup WordPress
Go back to the ‘WebStart page’ click ‘MY WEBSITE’ this will show a list of all the sites (folders) in the test area. Click the name of the one you renamed from the WordPress download ‘test’ this will bring up the WordPress install screen. You’ll follow the basic WordPress install instructions, select your language, ‘Continue’, then click ‘Let’s go’ on the next page. This page you’ll enter your database information like ‘Database name’ this is the name you just created ‘testdb’. Username and password you’ll use ‘root’, for testing. You’ll come up with your WordPress login name and password later. Click ‘Submit’
Click ‘Run the installation’
Now fill out the WordPress User and Password; write them down, you won’t be able to do an email password reset on local, you’ll have to go through and update it through the database. Don’t worry about the box saying discourage search engines, this is only local install and the search engines won’t be able to see the site.
When done hit ‘Install WordPress’, then ‘Log In’.
Then you will login with your WordPress user name and password that you wrote down.
From here you can test WordPress like it would be on the server, only faster. You can try plug-ins, themes, etc.
Turn off MAMP when you’re not using it, make sure to turn it back on when you want to work in the test sites.
The important things to remember this is a local install for testing only, when you’re ready to move up to the next level of building and deploying to a server look further into more secure ways of doing that. This way works great for trying out WordPress, themes, plug-ins and if you work with code to try locally then copy over to production.