In short: A Shopify local development environment is Shopify CLI on your machine connected to a free dev store. You cannot run Shopify itself locally. Install the CLI (Node.js 22.12 or higher), create a dev store, then run shopify theme dev to preview your local theme files at http://127.0.0.1:9292 with hot reload. Apps use shopify app dev and headless storefronts use shopify hydrogen dev.

Developers who come to Shopify from WordPress or Laravel usually look for the same thing first: how do I run this on my own machine? With WordPress you install PHP and MySQL, or spin up a container, and the whole site lives on localhost. Shopify does not work that way, and understanding the difference saves a lot of searching.

This guide explains how a Shopify local development environment actually works, then walks through the setup for themes, with shorter sections for apps and headless storefronts, and for running the whole thing on a local server or in Docker.

How Shopify Local Development Works

Shopify is a hosted platform. There is no downloadable copy of it, no database you can clone, and no way to render Liquid templates fully offline. What you get instead is a split setup:

  • Your code is local. Theme files, app code or a Hydrogen project sit in a folder on your machine, under Git.
  • The store is remote. Products, orders, settings and the Liquid rendering engine stay on Shopify’s servers, in a store made for testing.
  • Shopify CLI connects the two. It uploads your files to a hidden theme on that store, serves a preview through a local address, and reloads the browser when you save.

So the three building blocks are a dev store, Shopify CLI, and your project folder. If you are used to fully local stacks, such as the Docker-based ones in our DevEnv Manager guide, think of the dev store as the part of the stack you cannot containerize.

Step 1: Create a Dev Store

A dev store is a test store that you own and control. It is meant for development only and cannot take real payments. You need a Shopify Partner account, or a merchant store where you have developer permissions.

In the browser:

  1. Log in to the Dev Dashboard at dev.shopify.com/dashboard.
  2. Select Stores in the sidebar, then Create store.
  3. Choose Dev as the store type and enter a name. The name sets the myshopify.com address and cannot be changed later.
  4. Choose the plan to simulate (Basic, Grow, Advanced or Plus) and create the store.

Or from the terminal, once the CLI is installed (step 2):

shopify store create dev --name "Theme sandbox" --plan basic --demo-data --country US

The demo data option fills the store with generated test products and orders, which is what you want for theme work. An empty store shows you very little.

Things to know about dev stores:

  • They are always password protected, and the password page cannot be removed.
  • They cannot be converted to a production store or transferred to a client.
  • Test orders go through Shopify’s test payment gateway.
  • An organization can have up to 250 of them, so one per project or per developer is fine.

Step 2: Install Shopify CLI

Requirements: Node.js 22.12 or higher, a package manager (npm, Yarn 1.x or pnpm), and Git 2.28 or higher. It runs on Windows, macOS and Linux.

node -v
git --version

npm install -g @shopify/cli@latest
shopify version

On macOS you can use Homebrew instead:

brew tap shopify/shopify
brew install shopify-cli

Recent versions of the CLI upgrade themselves. To upgrade immediately, run this:

shopify upgrade

Step 3: Get a Theme onto Your Machine

You either start a new theme or download an existing one.

To start fresh, this clones Shopify’s Skeleton theme into a new folder:

shopify theme init my-theme
cd my-theme
git init && git add . && git commit -m "Initial theme"

To work on a theme that already exists in a store, pull it:

mkdir my-theme && cd my-theme
shopify theme pull --store my-dev-store

The CLI lists the themes in the store and asks which one to download. Use the live flag to take the published theme without being asked. The first time you run a command against a store, a browser window opens so you can log in.

shopify theme pull --store my-dev-store --live

Step 4: Start the Local Dev Server

shopify theme dev --store my-dev-store

The command uploads your local files to the store as a development theme and prints three links:

  • A local preview at http://127.0.0.1:9292
  • A link to the theme editor for that development theme
  • A preview link you can share with others

Open the local address and edit a file. CSS and section changes are hot reloaded without a full refresh; other changes reload the page. Shopify’s tutorial notes that the hot reload preview is only available in Google Chrome.

The store only has to be named once. After that the CLI remembers it for the project.

What a development theme is

It is a temporary, hidden theme tied to your CLI session. It does not count toward the store’s theme limit and customers never see it. It is deleted after seven days without activity, and also when you log out of the CLI. That makes it safe to run against a real store too, not only a dev store.

Useful options

# Dev stores are password protected: pass the storefront password
shopify theme dev --store-password "the-password"

# Bring changes made in the theme editor back into your local files
shopify theme dev --theme-editor-sync

# Full page reload instead of hot reload, or none at all
shopify theme dev --live-reload full-page
shopify theme dev --live-reload off

# Use another port, and open the browser automatically
shopify theme dev --port 9393 --open

The theme editor sync option matters more than it looks. Settings changed in the editor are saved to JSON files in the remote theme. Without the sync, your next upload overwrites them with your local copies.

One limit to remember: checkout customizations cannot be previewed at the local address.

Step 5: Check, Push and Publish

Run the linter before you upload. It catches Liquid errors, missing translations and performance problems.

shopify theme check

Then upload your work as a new unpublished theme, review it in the store, and publish when you are ready:

shopify theme push --unpublished
shopify theme publish

To hand a preview to a client without touching anything else, this uploads a copy under a random name and returns a link:

shopify theme share

Step 6: One Project, Several Stores

Most real projects have at least a dev store and a production store. Instead of typing store names on every command, describe them once in a file called shopify.theme.toml in the project root:

[environments.default]
store = "my-dev-store"

[environments.staging]
store = "client-staging"
theme = "123456789012"

[environments.production]
store = "client-store"
ignore = ["config/settings_data.json", "templates/*.json"]

Then pick the environment by name. The default one is used when you name none.

shopify theme dev
shopify theme push --environment staging
shopify theme pull --environment production

Ignoring the settings and template JSON files for production is a common safeguard. Those files hold what the merchant configured in the theme editor, and a careless push would replace it with your local version.

Running It on a Local Server or in Docker

You may want the dev server on a shared machine in the office, in a VM, or in a container, with the browser on another computer. Two things need to change.

Listen on the network

By default the server only accepts connections from the same machine. The host option controls which network interface it listens on:

shopify theme dev --host 0.0.0.0 --port 9292

The preview is then reachable at the server’s address on port 9292. Keep it on a trusted network or behind a firewall, because anyone who can reach that port sees the preview.

Log in without a browser

The normal login opens a browser, which a headless server or a container does not have. Use a password from Shopify’s Theme Access app instead. Install the app in the store, generate a password for yourself, and pass it through an environment variable:

export SHOPIFY_CLI_THEME_TOKEN="shptka_xxxxxxxxxxxx"
export SHOPIFY_FLAG_STORE="my-dev-store"

shopify theme dev --host 0.0.0.0

The same two variables are what you use in CI pipelines.

A minimal Docker setup

Shopify does not publish an official image for this, so the simplest approach is the Node image with the CLI installed on top:

# Dockerfile
FROM node:22-slim
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
RUN npm install -g @shopify/cli@latest
WORKDIR /theme
EXPOSE 9292
CMD ["shopify", "theme", "dev", "--host", "0.0.0.0", "--port", "9292"]
# docker-compose.yml
services:
  theme:
    build: .
    ports:
      - "9292:9292"
    volumes:
      - ./:/theme
    environment:
      SHOPIFY_CLI_THEME_TOKEN: ${SHOPIFY_CLI_THEME_TOKEN}
      SHOPIFY_FLAG_STORE: ${SHOPIFY_FLAG_STORE}

Put the two values in a file named .env next to the compose file, keep that file out of Git, and start the container:

docker compose up

The benefit is the same as with any containerized toolchain: everyone on the team runs the same Node and CLI versions, and nothing is installed on the host.

Apps and Headless Storefronts

Apps

App development follows the same idea. Your code runs locally, and the CLI connects it to a dev store:

shopify app init
cd your-app-folder
shopify app dev --store my-dev-store

The dev command builds the app, previews it on the dev store and watches for changes. If you prefer to work without a tunnel, there is a localhost mode, with the limitation that webhooks are not supported in it:

shopify app dev --use-localhost

Hydrogen

Hydrogen, Shopify’s framework for headless storefronts, is the one case that feels like classic local development, because the storefront really does render on your machine. The quickstart uses sample data from mock.shop, so you do not even need a store to begin:

npm create @shopify/hydrogen@latest -- --quickstart
cd hydrogen-quickstart
shopify hydrogen dev

The storefront opens at http://localhost:3000. To use your own store’s data, link the project and pull its environment variables:

npx shopify hydrogen link
npx shopify hydrogen env pull

These commands come from Shopify’s guide for Hydrogen 2026-04 and earlier. If you start on a newer release, check the current Hydrogen documentation first.

Common Problems

  • The preview shows a password page. Dev stores are always password protected. Pass the storefront password with the store password option.
  • Changes do not hot reload. Use Google Chrome, and check that you did not start the server with live reload off.
  • Editor changes disappeared. Someone customized the theme in the editor and a later upload overwrote the JSON files. Run the dev server with theme editor sync, and ignore those files when pushing to production.
  • Port 9292 is already in use. Another dev server is running. Stop it or choose a different port.
  • The development theme is gone. It is removed after seven days of inactivity or when you log out. Run the dev command again and it is recreated from your local files.
  • The CLI refuses to start. Check the Node.js version. Anything older than 22.12 is not supported.
  • Cannot reach the preview from another computer. The server listens on 127.0.0.1 by default. Start it with the host option set to 0.0.0.0.

Conclusion

A Shopify local development environment is not a local copy of Shopify. It is your files, a dev store, and Shopify CLI keeping the two in sync. Once that clicks, the workflow is quick to set up: create a dev store, install the CLI, pull or init a theme, and run the dev server. Add an environments file when a second store appears, and a container when a second developer does.

When the theme is ready for real traffic, measuring it is the next job. See our guide to Shopify GA4 tracking with a custom pixel.

Frequently Asked Questions

Can I run Shopify locally on my own server?

No. Shopify is a hosted platform and cannot be installed or self-hosted. Local development means your theme or app code is on your machine and Shopify CLI connects it to a remote store, usually a free dev store.

What do I need for a Shopify local development environment?

Node.js 22.12 or higher, Git 2.28 or higher, Shopify CLI, and a store to connect to. A dev store, created from the Dev Dashboard or with the shopify store create dev command, is the usual choice.

What URL does shopify theme dev use?

The local preview runs at http://127.0.0.1:9292 by default. The port can be changed with the –port option and the network interface with the –host option.

What is a Shopify development theme?

A temporary, hidden theme that Shopify CLI creates on the store when you run shopify theme dev. It does not count toward the theme limit and is deleted after seven days of inactivity or when you log out of the CLI.

Can I run Shopify CLI in Docker or on a headless server?

Yes. Start the dev server with –host 0.0.0.0 so it is reachable from other machines, and authenticate with a Theme Access password in the SHOPIFY_CLI_THEME_TOKEN environment variable instead of the browser login.

Is a Shopify dev store free?

Dev stores are provided for development and testing through a Shopify Partner account or a store with developer permissions. They cannot process real transactions, are always password protected, and cannot be converted into production stores.

Sources: Shopify CLI documentation, theme dev command reference, Shopify dev stores, Shopify CLI theme environments.