> For the complete documentation index, see [llms.txt](https://nghiaxchis.gitbook.io/ncmaz-nextjs-headless-cms-wordpres-blog-magazine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nghiaxchis.gitbook.io/ncmaz-nextjs-headless-cms-wordpres-blog-magazine/development-on-localhost/run-on-localhost.md).

# Run on localhost

### **Step 1 - Requirements:**

1. System Requirements:  [Node.js 16.14](https://nodejs.org/) or later.
2. Completed step [Step 2. Install the WP theme & plugins.](/ncmaz-nextjs-headless-cms-wordpres-blog-magazine/getting-started-setup/step-2.-install-the-wp-theme-and-plugins..md) and step [Step 3. Check Your Permalinks and WPGraphQL Settings](/ncmaz-nextjs-headless-cms-wordpres-blog-magazine/getting-started-setup/step-3.-check-your-permalinks-and-wpgraphql-settings.md)<br>
3. You need to have the environment variables ready and correct -  [Step 4. Update environment variables.](/ncmaz-nextjs-headless-cms-wordpres-blog-magazine/getting-started-setup/step-4.-update-environment-variables..md)\
   \
   **Note,** that you need to have the `.env` or `.env.local` file by copying the `.env.local.example` file available in the root directory of the **Ncmaz-faust** project.

### **Step 2 -** Try deploying on the localhost:

1. System Requirements:  [Node.js 16.14](https://nodejs.org/) or later.
2. Run `npm run dev` to start the development server.
3. Visit `http://localhost:3000` to view your application.
4. Runs [`next build`](https://nextjs.org/docs/app/api-reference/next-cli#build) to build the application for production usage.
5. Runs [`next start`](https://nextjs.org/docs/app/api-reference/next-cli#production) to start a Next.js production server - `http://localhost:3000`

{% hint style="info" %}
**Note when developing localhost: `npm run dev`**

In case the WordPress URL is like: **<http://localhost/your-blog>** and your **Front-end Site URL** is **<http://localhost:3000>**, the conflict error will also occur, because they have the same **localhost** origin.

And then this error may occur: "*Error - Validation Failed: Your Faust front-end site URL value is misconfigured. It should NOT match the NEXT\_PUBLIC\_WORDPRESS\_URL*."

So the solution is to customize one of those two URLs so they are different, you should consider using Atlas and/or [Local](https://localwp.com/) for your local WordPress. Or simply temporarily remove the **Front-end Site URL** field in *`Settings → Faust`* (only do this temporarily during localhost development and cannot customize the URLs)
{% endhint %}

### Video try to run dev on the localhost

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrDDvIKPQvgLvQ5xJBSo%2Fuploads%2F2w4VoybeymEYBHmCjiDA%2Fncmaz-faust-started.webm?alt=media&token=527d35fa-2d22-41c7-af2b-8e01aa75e007>" %}

{% file src="/files/944QzYH2hUFe6LddGWlb" %}
