WooCommerce is a plugin for WordPress, which is a free and open-source CMS. This product currently competes with Magento and Prestashop for creating online stores; you can find more details on its website.
Preparing the VPS Server for WooCommerce
WooCommerce does not require many resources initially; to get started, we can use it on a Server with Ubuntu 16.04 with 1GB of RAM, 1 Core and 25GB of disk space. Later, it needs to be sized according to the total number of products and visits our online store receives.
First of all, we need to follow the steps in the article install LAMP (except for the PHP installation). We will use these commands:
# a2enmod rewrite
# add-apt-repository universe
# apt-get install php libapache2-mod-php php-cli php-mysql php-mcrypt php-zip php-ldap php-curl php-gd php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap php-intl curl
# service apache2 restart
Creating the Database
We log in to MySQL as the user root:
# mysql -u root
We create the database for WordPress, create a user and configure the permissions. For this tutorial, we have decided to name both the database and the user wordpress. Replace p4ssw0rd with a secure password.
CREATE DATABASE wordpress;
CREATE USER 'wordpress' IDENTIFIED BY 'p4ssw0rd';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress';
We exit the MySQL shell:
quit
Installing WordPress
Once we have configured the Web Server, it is time to install WordPress on it. We will go to the Spanish WordPress website, download the latest version 4.7.5 and unzip it:
# cd /var/www/html
# rm index.html
# wget https://es.wordpress.org/wordpress-4.7.5-es_ES.zip
# unzip wordpress-4.7.5-es_ES.zip
# rm wordpress-4.7.5-es_ES.zip
# chown -R www-data:www-data ./*
* if the unzip program is not installed on the server, we can use apt-get install zip unzip
We can now use our browser to access the server IP or the domain where we want to install WordPress, (http://tuip/wordpress) and we will see the wizard to install WordPress.
Then we enter the database details:
After this, we perform the CMS installation by specifying the administrator user details:
Once WordPress is installed, we will go to the plugin installer and search for WooCommerce.
We will click instalar and then activar, and it will be ready to configure.
Next, we configure the WooCommerce plugin in several steps:
We configure the store location (Barcelona, Spain), the currency (euro) and the dimensions for measurement:
Next, we configure shipping and taxes:
Finally, we select the payment gateways we are going to use (Paypal and Stripe):
From here, we finish and click Crear primer producto:
This will take us to the product creation page where we can create the first product.
With this tutorial, we have performed a default installation of WooCommerce on WordPress in a few simple steps.
The writer of this article is Carlos Castro, author of the blog eXperiencia, Recursos y Learning en Tech Corner, where he provides guides, tutorials and software tools in Spanish.