Shopify themes can also be developed locally. Follow the steps below to setup local development environment:
Explanation of the above steps are as follows:
Install Shopify Theme Kit
Automatic Installation
If you are on Mac or Linux you can use the following installation script to automatically download and install Theme Kit for you.
curl -s https://raw.githubusercontent.com/Shopify/themekit/master/scripts/install | sudo python
Homebrew
If you have homebrew installed you can install Theme Kit by running the following commands.
brew tap shopify/shopify
brew install themekit
Automatic Powershell Install
Run the following commands in Powershell as Administrator.
(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/Shopify/themekit/master/scripts/install.ps1") | powershell -command -
Manual
Manual Installation
Download the latest release executable.
OS | Architecture | Link |
---|---|---|
macOS | 64-bit | Download |
Windows | 64-bit | Download |
Windows | 32-bit | Download |
Linux | 64-bit | Download |
Linux | 32-bit | Download |
You will need to set up an API key to add to our configuration and create a connection between your store and Theme Kit. The API key allows Theme Kit to talk to and access your store, as well as its theme files.
To do so, log into the Shopify store, and create a private app. In the Shopify Admin, go to Apps and click on View private apps. From there, click Generate API credentials to create your private app. Make sure to set the permissions of Theme templates and theme assets to have Read and write access in order to generate the appropriate API credentials, then click Save.
Fill out the information at the top and set the permissions of Theme templates and theme assets to read and write access. Press Save and you will be presented with the next screen. In it you will see your access credentials. Please make note of the password. You will need it later.
Use a new theme.
If you are starting from scratch and want to get a quick start, run the following:
theme bootstrap --password=[your-password] --store=[your-store.myshopify.com]
This will create a new theme for your online store from the Timber template. Then it will download all those assets from Shopify and automatically create a config.yml file for you.
Configure an existing theme.
To connect an existing theme, you need the theme’s ID number. The easiest way to get your theme’s ID number is to go to the Theme Editor click on Edit HTML/CSS and copy the theme ID number from the URL — it will be last several digits after mystore.myshopify.com/admin/themes/.
Then once you have noted your theme ID, run the following commands:
# create configuration
theme configure --password=[your-password] --store=[you-store.myshopify.com] --themeid=[your-theme-id]
# download and setup project in the current directory
theme download