Setting up a WooCommerce store in Codesphere

A tutorial about setting up WooCommerce on Codesphere.

December 14, 2023 3 Min Read
Setting up a WooCommerce store in Codesphere
Setting up a WooCommerce store in Codesphere

Codesphere

From everyone in the Codesphere Team:)

Table of Contents

WooCommerce is the leading e-commerce plugin for WordPress. It is highly customizable, open-source and given the right hosting setup can power large e-commerce businesses. Setting it up in Codesphere is really simple.

Prerequisites

  • A MySQL database (can be provisioned in our Marketplace in a few clicks if needed, explained below)
  • A Codesphere account (free sign up)

Create a new workspace

Navigate to the team where you want to create your store and click new workspace.

WordPress template

Select the WordPress template, provide a name for your application and select a plan (for testing the small plan will be sufficient, for any production environment go for Boost or higher):

Create a new database (Skip if a hosted database is already available)

To create a new MySQL database follow these steps:

  1. 1.Navigate to Marketplace
  2. 2.Select the MySQL from the services
  3. 3.Provide name and select resources
  4. 4.Hit Create
  5. 5.Once provisioned, click Show info
  6. 6.You will need these in the next step

The provisioning will take some time (~3 min), after that continue.

Find your WordPress config file

Back in your created Codesphere workspace open html/wp-config.php and scroll to the database settings.

Update the database entries

Edit the following entries of the WordPress installation to point them to the correct database (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST).

Make sure to append the port (:25060 for DigitalOcean) to your DB_HOST

We recommend the use of environment variables for securely storing sensitive information such as secrets or passwords. However, in this instance, we directly input these details into the wp-config.php file on the server side. As we ensure this file is excluded from our repository commits, this method does not compromise the security of the sensitive data in this particular case.

Generate and insert app secrets and salts

Scroll down to the authentication and salt keys part of your wp-config file. Open this link in any browser to generate a new set of keys: https://api.wordpress.org/secret-key/1.1/salt/Copy the string snippet generated into your wp-config file, replacing the empty keys.

Run your application

Navigate to CI Pipeline, select the run stage and click the run button. Now Wordpress will start up.

Finish the WordPress setup

Open your deployment and follow the steps on the screen to finish up the WordPress installation.

Install plugins as needed

Now you have a clean WordPress installation, if you want to install WooCommerce it’s just a few clicks away via the Plugins tab. Follow the guided steps and you will have your shop up and running in no time.Once you are ready to take your shop live you might want to connect a custom domain by following this tutorial: Custom Domains

Check out the following tutorials to learn more:

About the Author

Setting up a WooCommerce store in Codesphere

Codesphere

From everyone in the Codesphere Team:)

We are building the next generation of Cloud, combining Infrastructure and IDE in one place, enabling a seamless DevEx and eliminating the need for DevOps specialists.

More Posts

Deploying Landscapes on Codesphere

Deploying Landscapes on Codesphere

Learn how to deploy and run multiple services that can independently scale vertically and horizontally within a single workspace. Suitable for hosting entire application landscapes.

Monitoring & Alerting

Monitoring & Alerting

Learn how to access Codesphere's built in resource monitoring and check the uptime of your applications.

Path-Based Routing

Path-Based Routing

Learn how to connect multiple independent applications to a single domain by associating different paths with distinct workspaces