How to setup a local shopify theme development environment
Ilias Haddad - Shopify Developer | Full Stack Developer | Freelancer
December 08, 2020 - 1 min read
In the seventh article, As requested, I'll be talking about how to set up a local shopify theme development environment.
Let's go!
To create unlimited Shopify stores for development, you can create a Shopify Partner account using this link
Install ThemeKit
ThemeKit is the Offical Shopify tool to work with Shopify themes locally
macOS Installation
brew tap shopify/shopify
brew install themekit
Windows Chocolatey Installation
choco install themekit
Linux Installation
curl -s [<https://shopify.github.io/themekit/scripts/install.py>](<https://shopify.github.io/themekit/scripts/install.py>) | sudo python
Create Private Shopify App
Go Admin > Apps and click on manage private apps at the bottom of the page
Create a new private app and select Themes with reading and write permissions
- Copy the Password
Configure ThemeKit
- Go Online Store > Themes and click on edit code for the Shopify theme you want to work with locally
- In the URL bar, you'll have the Shopify theme ID like this one https://ilias-demo.myshopify.com/admin/themes/ID
Create a directory for this theme
Run this command to download your theme code
theme get -p=your-password -s=[you-store.myshopify.com](<http://you-store.myshopify.com/>) -t=your-theme-id
and run this command to watch for file changes and upload them automatically to your remote Shopify theme
theme watch
It's recommend to have config file, to prevent from overwiring the config/settings_data.json file that have the Shopify theme data like Shopify sections content or have different environement
development:
password: Password
theme_id: theme_id
store: example.myshopify.com
ignore_files:
- config/settings_data.json
production:
password: Password
theme_id: theme_id
store: example.myshopify.com
test:
password: Password
theme_id: theme_id
store: example.myshopify.com
References: