Skip to the article
Aniq-UI

SaaS Landing PagePut it online

Put it online

Publish the landing page on Vercel, on any server that runs Node.js, or as a Docker image.

Before you deploy

Set NEXT_PUBLIC_SITE_URL to the address the site will have, such as https://www.your-domain.com. It is compiled into the page when it is built, so it has to be set where the build runs, not only where the site runs.

Set NEXT_PUBLIC_API_BASE_URL too if you show the newsletter section. Nothing else is needed: there is no database and no secret.

Vercel

  1. Put the folder in a Git repository

    Push the landing-page-template-2 folder to GitHub, GitLab or Bitbucket. The download already has a .gitignore that keeps out node_modules, the build and your .env files.

  2. Import it in Vercel

    In Vercel, add a new project from that repository. It detects Next.js; keep the default build settings.

  3. Add the environment variables

    Under the project's Environment Variables, add NEXT_PUBLIC_SITE_URL with your address, and ENABLE_EXPERIMENTAL_COREPACK with the value 1 so Vercel installs with the Yarn 4 version that package.json pins.

  4. Deploy

    Start the deployment, then add your domain in the project's Domains settings.

    Expected result: Your domain opens the landing page.

After you change a variable, deploy again: the running site keeps the values it was built with.

Any server with Node.js

On a server with Node.js 22 or newer, copy the folder, set the variables, then install, build and start:

Terminalin landing-page-template-2
corepack enable
yarn install
NEXT_PUBLIC_SITE_URL=https://www.your-domain.com yarn build
yarn start

You can also put the values in a .env.local file in the folder before yarn build. The site answers on port 3030. Put a web server such as Nginx or Caddy in front of it for your domain and HTTPS, and keep yarn start running with a process manager or a system service.

Hosts that choose the port

yarn start always listens on 3030, even when the host sets a PORT variable. On a host that gives you a port, make the start command yarn start -p $PORT.

A Docker image

The Dockerfile builds a small image that serves the site with Node.js on port 3030. Pass your settings when you build it, then run it in the background so it restarts with the server:

Terminalin landing-page-template-2
docker build -t saas-landing --build-arg NEXT_PUBLIC_SITE_URL=https://www.your-domain.com .
docker run -d --restart unless-stopped -p 3030:3030 saas-landing

Add --build-arg NEXT_PUBLIC_API_BASE_URL=… when you use the newsletter. Any host that runs a Dockerfile can build it as it is. Put a web server in front of port 3030 for your domain and HTTPS, as for Node.js.

After it is online

  • Open your address with /en and /ar and check both languages.
  • View the page source and check that the canonical link starts with your domain, not localhost. If it does not, NEXT_PUBLIC_SITE_URL was not set when the site was built.

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.