The love hate relationship between developers that use Squarespace just improved with the introduction of a key feature for dev teams. The ability to run a local server!
Squarespace Local Development Server
The Development Server allows you to locally preview changes made to the template code, rather than testing changes live.
What’s interesting is this allows teams to collaborate for simultaneous editing with ease using Git. Even lone developers will prefer the easier method for testing ideas at speed locally.
Getting Started with the Squarespace Local Development Server
- First you will require NPM. This can be downloaded and installed separately, but the easiest way is to download the Node.js® package. https://nodejs.org (More Info.)
- Simply update the NPM using NPM by running this command:
sudo npm install npm -g
- Now time to download the Squarespace Local Development Server via the NPM package:
npm install -g @squarespace/squarespace-server
For more information on installation see the Developer documentation.
Now you will need a Squarespace website with Developer mode activated, it’s assumed you know how to do this but if not read the getting started.
Create a local folder where you want to store the website, I typically do this in My Documents in a folder called Websites so I would run these commands to start with a template for editing:
git clone https://site-name.squarespace.com/template.git
Once the template is cloned using git we can edit it in our favourite editor, I have been enjoying Atom, but I won’t get into the choices of code editors.
The next step is to test the site locally, this can be done with:
If your on a trial you will find that you need to add this and login
Congratulations! You can now view your website locally.
Open a browser and visit http://localhost:9000 to see your local website.
Any questions feel free to leave a comment, or reach out to Squarespace!