> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/woocommerce/woocommerce/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart Guide

> Get started with WooCommerce development in under 10 minutes.

## Overview

This quickstart will get you from zero to a working WooCommerce development environment with your first customization in under 10 minutes.

<Note>
  This guide assumes you have basic familiarity with Git, command line, and either PHP or JavaScript development.
</Note>

## Prerequisites

Before you begin, ensure you have:

<Steps>
  <Step title="Node.js (via NVM)">
    Install Node Version Manager to manage Node.js versions:

    ```bash theme={null}
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
    ```
  </Step>

  <Step title="PNPM">
    Install PNPM package manager globally:

    ```bash theme={null}
    npm install -g pnpm
    ```
  </Step>

  <Step title="PHP 7.4+ and Composer">
    Install PHP and Composer for your operating system:

    <Tabs>
      <Tab title="Ubuntu/Debian">
        ```bash theme={null}
        sudo apt update
        sudo apt install php php-cli php-mbstring php-xml composer
        ```
      </Tab>

      <Tab title="macOS (Homebrew)">
        ```bash theme={null}
        brew install php composer
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Get Started in Three Steps

### Step 1: Clone and Install

Clone the WooCommerce repository and install dependencies:

```bash theme={null}
# Clone the repository
git clone https://github.com/woocommerce/woocommerce.git
cd woocommerce

# Install the correct Node.js version
nvm install

# Install all dependencies (this may take a few minutes)
pnpm install

# Build all packages and plugins
pnpm build
```

<Info>
  The `pnpm install` command installs dependencies for all packages in the monorepo. The `pnpm build` command compiles TypeScript, bundles JavaScript, and prepares all packages for development.
</Info>

### Step 2: Start WordPress Environment

Start a local WordPress development environment with WooCommerce:

```bash theme={null}
# Navigate to the WooCommerce plugin directory
cd plugins/woocommerce

# Start the WordPress environment (requires Docker)
pnpm -- wp-env start
```

<Note>
  First start will take 5-10 minutes as Docker downloads WordPress and sets up the database. Subsequent starts are much faster.
</Note>

Once started, access your development site:

* **Site URL**: [http://localhost:8888](http://localhost:8888)
* **Admin URL**: [http://localhost:8888/wp-admin](http://localhost:8888/wp-admin)
* **Username**: `admin`
* **Password**: `password`

### Step 3: Make Your First Change

Let's add a custom message to the WooCommerce product page:

<Steps>
  <Step title="Create a custom plugin">
    Create a new file `plugins/woocommerce/.wordpress-org/local-plugins/wc-quickstart.php`:

    ```php theme={null}
    <?php
    /**
     * Plugin Name: WooCommerce Quickstart
     * Description: My first WooCommerce customization
     * Version: 1.0.0
     */

    // Add a message after the product title
    add_action( 'woocommerce_single_product_summary', function() {
        echo '<p style="color: #843cfb; font-weight: bold;">'
           . 'Custom message from my quickstart plugin!'
           . '</p>';
    }, 6 );
    ```
  </Step>

  <Step title="Activate the plugin">
    Visit [http://localhost:8888/wp-admin/plugins.php](http://localhost:8888/wp-admin/plugins.php) and activate "WooCommerce Quickstart".
  </Step>

  <Step title="View your change">
    Visit any product page at [http://localhost:8888/shop/](http://localhost:8888/shop/) and see your custom message appear below the product title!
  </Step>
</Steps>

<Tip>
  **Congratulations!** You've just created your first WooCommerce customization using action hooks.
</Tip>

## What You Just Did

Let's break down the hook you used:

```php theme={null}
add_action( 'woocommerce_single_product_summary', function() {
    // Your custom code
}, 6 );
```

* **`add_action()`**: Hooks your function into a specific WooCommerce action
* **`woocommerce_single_product_summary`**: The hook that fires on product pages
* **Function**: Your custom code to execute
* **`6`**: Priority (controls when your code runs relative to other hooked functions)

<Info>
  WooCommerce has hundreds of hooks like this that let you customize every aspect of the store without modifying core code.
</Info>

## Next Steps

Now that you have a working environment, here's what to explore next:

<CardGroup cols={2}>
  <Card title="Learn About Hooks" icon="link" href="/extensions/hooks-filters">
    Master WooCommerce's extensive hook system
  </Card>

  <Card title="Build an Extension" icon="puzzle-piece" href="/extensions/first-extension">
    Create a complete WooCommerce extension
  </Card>

  <Card title="Explore the REST API" icon="code" href="/api/rest-api/overview">
    Integrate with products, orders, and customers
  </Card>

  <Card title="Theme Development" icon="palette" href="/themes/overview">
    Customize the storefront appearance
  </Card>
</CardGroup>

## Common Development Tasks

### Running Tests

```bash theme={null}
# Run PHP tests
cd plugins/woocommerce
pnpm test:php

# Run JavaScript tests
pnpm test:js
```

### Building Assets

```bash theme={null}
# Build WooCommerce Core
pnpm --filter='@woocommerce/plugin-woocommerce' build

# Build all JavaScript packages
pnpm --filter='./packages/js/*' build

# Watch for changes (auto-rebuild)
pnpm --filter='@woocommerce/plugin-woocommerce' start
```

### Working with wp-env

```bash theme={null}
# Stop the environment
pnpm -- wp-env stop

# Restart the environment
pnpm -- wp-env start

# Destroy the environment (removes all data)
pnpm -- wp-env destroy

# Run WP-CLI commands
pnpm -- wp-env run cli wp plugin list
```

## Troubleshooting

<Accordion title="Port 8888 already in use">
  Another application is using port 8888. Stop it or configure wp-env to use different ports by editing `.wp-env.json` in `plugins/woocommerce/`.
</Accordion>

<Accordion title="Docker not running">
  wp-env requires Docker. Install [Docker Desktop](https://www.docker.com/products/docker-desktop) and ensure it's running before starting wp-env.
</Accordion>

<Accordion title="Build errors">
  Try cleaning and reinstalling:

  ```bash theme={null}
  pnpm clean
  pnpm install
  pnpm build
  ```
</Accordion>

<Accordion title="PHP errors">
  Make sure you have all required PHP extensions:

  ```bash theme={null}
  php -m | grep -E 'mbstring|xml|curl|zip'
  ```

  If any are missing, install them via your package manager.
</Accordion>

## Learn More

<CardGroup cols={3}>
  <Card title="Development Environment" icon="laptop-code" href="/development-environment">
    Detailed environment setup guide
  </Card>

  <Card title="Project Structure" icon="folder-tree" href="/project-structure">
    Understanding the monorepo
  </Card>

  <Card title="Architecture" icon="diagram-project" href="/core-concepts/architecture">
    Learn WooCommerce architecture
  </Card>
</CardGroup>

## Get Help

Stuck? Here's where to get help:

* **[WooCommerce Slack](https://woocommerce.com/community-slack/)**: Join the developer community
* **[GitHub Discussions](https://github.com/woocommerce/woocommerce/discussions)**: Ask questions and share ideas
* **[Developer Blog](https://developer.woocommerce.com/blog/)**: Stay updated with development news


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.