This introduction will walk you through the process of installing WordPress, setting up WooCommerce, creating WooCommerce API keys (wc_key and wc_secret), and how to add sample products.
For your WordPress website setup, I show you three different methods: LocalWP, MAMP, and Docker Compose.
Of course, there are more methods, but in the end, it all depends on your preferences and what you want to use.
Before you begin, ensure that you have the following prerequisites installed on your computer:
Or if you already have your own wordpress site go to:
Setting Up WooCommerce - section
Creating WooCommerce API Keys - section
How To Add Sample Products - section
-
Download and install LocalWP on your computer from the official website.
-
Launch LocalWP and create a new site.
-
Choose the desired PHP version, MySQL version, and site name during the setup.
-
Click on the "Start Site" button to create your WordPress site.
-
Follow the on-screen instructions to set up your WordPress site, including creating an admin account and site title.
-
Access your WordPress site by clicking the "View Site" button within LocalWP.
-
Follow the on-screen instructions to complete the WordPress installation, including creating an admin account and site title.
-
Download and install MAMP from the official website.
-
Launch MAMP and start the Apache and MySQL servers.
-
Download WordPress from wordpress.org and unzip the files to a folder in your MAMP "htdocs" directory (e.g.,
htdocs/wordpress
). -
Create a new MySQL database for your WordPress site using the phpMyAdmin interface provided by MAMP.
-
Rename the
wp-config-sample.php
file in the WordPress folder towp-config.php
. -
Edit the
wp-config.php
file and update the database configuration with the database name, username, and password created in step 4. -
Open your web browser and navigate to
http://localhost:8888/wordpress
(or the appropriate port and directory where you installed WordPress). -
Follow the on-screen instructions to complete the WordPress installation, including creating an admin account and site title.
-
Once the installation is complete, you can access your WordPress site by navigating to
http://localhost:8888/wordpress
.
-
Install Docker on your computer from Docker's official website.
-
Create a directory for your WordPress project and navigate to it using your terminal.
-
Create a
docker-compose.yml
file in your project directory with the following content:
version: '3'
services:
wordpress:
image: wordpress
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepassword
WORDPRESS_DB_NAME: exampledb
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: examplepassword
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepassword
-
Open your terminal and navigate to the project directory.
-
Run the following command to start the Docker containers: docker-compose up -d
-
Once the containers are up and running, open your web browser and navigate to http://localhost:8080.
-
Follow the on-screen instructions to complete the WordPress installation, including creating an admin account and site title.
-
Log in to your WordPress dashboard using the admin account you created.
-
Navigate to Plugins in the WordPress dashboard.
-
Search for WooCommerce and install the WooCommerce plugin.
-
Activate WooCommerce.
-
Follow the WooCommerce setup wizard to configure your online store, including payment gateways, shipping options, and product settings. Most of them are not required; you don't need to fill them out, so you can just skip the whole thing and go to the next section. I only recommend one thing, which is choosing some shipping option; without it, you won't be able to make an order.
-
Log in to your WordPress dashboard.
-
Go to WooCommerce > Settings.
-
Click on the Advanced tab within WooCommerce settings.
-
Click on the REST API sub-tab.
-
Click the "Add Key" button to create a new API key.
-
Fill in the required information, such as description and permissions.
-
Click "Generate API Key."
-
The Consumer Key (wc_key) and Consumer Secret (wc_secret) will be generated. Make sure to copy and store them securely.
To add sample products to your site, you can follow the instructions on the official WooCommerce website.