Skip to the article
Aniq-UI

SaaS TemplateSettings

Settings

Every setting the site reads, its default, and how to change it with Docker and without.

The settings

Every setting is optional: the site runs without any of them.

VariableDefaultWhat it does
NEXT_PUBLIC_SITE_URLhttp://localhost:3030The public address of the site, with https:// and without a slash at the end. The canonical links, the links between the two languages, the sitemap, robots.txt and the social sharing cards are built from it. Set it to your domain before you go live.
NEXT_PUBLIC_BUY_URLemptyWhen set, a strip at the bottom of the footer shows a "Buy This Template" button that opens this address in a new tab. Leave it empty.
BUILD_STANDALONEemptytrue builds a self-contained server into .next/standalone. The Dockerfile sets it for you. Leave it empty for yarn start.

Without Docker

Copy .env.example to .env.local and edit the values there. Keep .env.example as it is, as the list of what exists.

Terminalin Nextjs-landing-page-template-2
cp .env.example .env.local
.env.local
NEXT_PUBLIC_SITE_URL=https://www.your-domain.com

With Docker

The image build does not read .env or .env.local files. Pass each value as a build argument instead:

Terminalin Nextjs-landing-page-template-2
docker build -t analytics-landing --build-arg NEXT_PUBLIC_SITE_URL=https://www.your-domain.com .

The site inside the container always listens on port 3030. To use another port on your computer, change the number on the left of -p when you start it.

When a change takes effect

Values that start with NEXT_PUBLIC_ are compiled into the JavaScript the browser loads when the site is built. Changing one changes nothing until the site is built again:

How you run itAfter changing a value
yarn devStop the server and run yarn dev again.
yarn build and yarn startRun yarn build again, then yarn start.
DockerBuild the image again with the value as a --build-arg, then start a new container.
VercelChange it in the project's Environment Variables and deploy again.

Never put a secret in a NEXT_PUBLIC_ value: every visitor can read it in the page's code. Keys for your own services belong on your server.

The standalone build

With BUILD_STANDALONE=true, yarn build writes a server that needs no node_modules into .next/standalone. The Dockerfile uses it to keep the image small. yarn start is not meant for that kind of build and warns "next start" does not work with "output: standalone" configuration. Leave the variable empty unless you copy the standalone folder to a server yourself.

Stuck on a step?

Find a fix before you start over.

Troubleshooting

Cookie Preferences

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies for analytics and personalized advertising.