Local Development
Now you can work on template code locally using the Squarespace Local Development Server. The local development server is a command line tool that sets up a test server on your computer, allowing you to see changes to your template before making them "live."
NOTE: Prior to developing locally, you'll need a website set up with developer mode enabled. (See Getting Started)
Installing the Dev Server
To begin working locally, you first must download and install the Squarespace Local Development Server. This tool is available via Node Package Manager (NPM). Here are the steps required:
Install NPM: If you don't have NPM installed you'll need to set that up first, by following the NPM installation guide. You'll also need to ensure you have the appropriate permissions configured for NPM.
Install squarespace-server: You can do this with the following NPM command:
npm install -g @squarespace/squarespace-server
Using the Dev Server
First you need to have your template in Developer Mode, and have cloned your site into a folder using Git. (See Getting Started):
git clone https://site-name.squarespace.com/template.git cd template
Then, to start Dev Server, run the following command:
squarespace-server https://site-name.squarespace.com
After starting squarespace-server, you will see the following screen:
Starting Development Server
_
/ / _
/ / / / \
/ / / / / | Squarespace Inc.
| / / / / / Local Development Environment
\ _ / / / /
/ /
-
Version 0.1.00
Listening on port 9000
The start-up message displays both the version of squarespace-server, and the port on which the server is running.
Now you can open your browser to your site by typing in the url http://localhost:9000. Any changes you make to your local template files will be visible when you refresh your browser.
Advanced Use
You can view all the options with the command:
If you have a site password, or your site is in trial mode, you'll need to log into your site via the dev server. You can do that with the following command:
Here's a list of some of the more useful options:
-h --help Show this screen. -d --template-directory=PATH Path to template source. -p --port=PORT Port that server listens on. --run-authenticated Login when starting server. --verbose Verbose logging.
Help and Feedback
If you have questions about working locally, or would like to provide feedback on Dev Server, please contact support and be sure to let them know you're using the Squarespace Local Development Server.