How to run Netlify CMS admin locally?
📋 Table Of Content
In this article we will learn how to run Netlify CMS locally in your PC.
Netlify CMS is a open-source content management system that works on git workflow and provide us with editors and User-Friendly UI.
In Netlify, to get on working with the CMS dashboard, wee need to add a
admin folder which consist the
index.html and a
config.ymlfile. The config.yml file helps us to create all the fields and properties that we need in our dashboard.
/admin is the public route through which we can access our dashboard on our website. And we can only access the admin route when the site is live.
If we try to access the admin route in our localhost, it shows us an error:
Unable to access identity settings. When using git-gateway backend make sure to enable Identity service and Git Gateway.
So, to work on your Netlify CMS admin on your localhost, just follow the steps below.
Run Netlify CMS admin locally
To run Netlify CMS in your local machine ( in localhost) :
Step 1 : Add
local_backend: true in your config.yml file in your admin folder.
Step 2 : Run
npx netlify-cms-proxy-server from the root directory of your repository
The proxy-server will run on a different PORT , usually port 8081.
Step 3 : Now run your site on your localhost and then goto
/adminroute , you will be able to access your CMS dashboard.
NOTE: The content or changes that you do in your admin will be strored locally, to build and deploy on your live site, you have to push your commits to your git.