Skip to main content
It does not work on LeaderOS Web Hosting (shared hosting). Next.js themes need a continuously running Node.js process, and shared hosting cannot run a Node.js server. You must publish your theme on your own VDS/VPS or a platform that supports Node.js. Your LeaderOS site itself (API, admin panel) keeps running on its current hosting.

Architecture

  • LeaderOS site (play.example.com): API, admin panel, payment callbacks. It must keep running.
  • Theme (shop.example.com): the address players visit. It pulls data from LeaderOS.

Requirements

1. Prepare the server

2. Get the project onto the server

3. Environment variables

Create /var/www/my-theme/.env.production on the server:
Do not add .env* files to Git. If you regenerate the key, update this file and restart the app.

4. Build and start

The app listens on port 3000 by default. For another port: PORT=3100 pm2 start npm --name leaderos-theme -- start.

5. Nginx reverse proxy

/etc/nginx/sites-available/leaderos-theme:
The X-Forwarded-For header matters: the theme forwards the visitor’s real IP address to LeaderOS with it (registration limit, logs and so on). If you use Cloudflare, make sure the real IP is passed through correctly.

6. SSL (HTTPS)

The certificate renews automatically. HTTPS is required on a live site; otherwise cookies and payment providers cause problems.

7. Configure the LeaderOS panel

In Settings → Headless API:
1

Frontend URL

Enter https://shop.example.com. E-mail links and payment returns now come to your theme.
2

Page paths

Leave the defaults if you use the template’s; if you changed them, enter the same paths.
3

Origins

Not needed for the template, which uses the proxy. If you call the API directly from the browser, add https://shop.example.com. “Allow all origins” must be off.

8. Payment providers

  • Browser return: after paying, the player returns to your theme’s /payment/success and /payment/error pages.
  • Server notifications (callbacks/webhooks) keep arriving at LeaderOS: the PayTR notification URL, Stripe/Shopier webhooks and so on. Do not change your existing settings; they must still point to your LeaderOS site.
  • Test the payment flow end to end with a small amount before going live.

Updating

Troubleshooting

Check the “Powered by LeaderOS” link in the footer before going live. If it is hidden, the page is replaced with a notice.