Payload CMS installation
Local Installation
Section titled “Local Installation”The local installation is recommended when you want to customize the template, develop new features, or test your store before deploying it to production.
Prerequisites
Section titled “Prerequisites”Make sure the following software is installed on your computer:
- Node.js
- pnpm
- PostgreSQL
- Git (optional)
You can verify Node.js and pnpm with:
node -vpnpm -vInstalling Payload CMS Locally
Section titled “Installing Payload CMS Locally”-
Extract the Template
Extract the downloaded main ZIP file into a folder on your computer.
For example:
C:\Users\YourName\Desktop\mainOpen Command Prompt or Terminal inside the project folder.
-
Install Dependencies
Run the following command to install all required project dependencies:
Terminal window pnpm iWait until the installation completes successfully.
Important: Make sure
pnpm ifinishes without errors before continuing. -
Create a PostgreSQL Database
Create a new PostgreSQL database for the application.
You can use pgAdmin, DBeaver, PostgreSQL CLI, or another PostgreSQL management tool.
Example database details:
Database: ecommerceUsername: postgresPassword: your-passwordHost: 127.0.0.1Port: 5432If you want to create the database using the PostgreSQL command line, navigate to the PostgreSQL
bindirectory:Terminal window cd "C:\Program Files\PostgreSQL\18\bin" -
Connect to PostgreSQL
Run:
Terminal window psql -h 127.0.0.1 -U postgresEnter your PostgreSQL password when prompted.
-
Create the Database
Inside the PostgreSQL console, create your database:
CREATE DATABASE ecommerce;You can verify the database was created successfully with:
\lExit PostgreSQL with:
\q -
Configure Environment Variables
Open the
.envfile in the project root.Add your PostgreSQL connection details and other required configuration values.
Example:
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/ecomnew71PAYLOAD_SECRET=091838d33373e774atytyNEXT_PUBLIC_SERVER_URL=http://localhost:3000NEXT_PUBLIC_APP_URL=http://localhost:3000PAYLOAD_PUBLIC_SERVER_URL =http://localhost:3000SERVER_URL=https://payloadecommerce.codenik.inSMTP_HOST=smtp.gmail.comSMTP_USER=codenikin@gmail.comSMTP_PASS=abfp nucn anpv yrgaSTRIPE_SECRET_KEY=sk_test_51XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51HxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSTRIPE_WEBHOOKS_SIGNING_SECRET=whsec_PAYLOAD_ENABLE_JOB_QUEUE=trueWHATSAPP_API_KEY=GOOGLE_CLIENT_ID=GOOGLE_CLIENT_SECRET=NEXT_PUBLIC_GOOGLE_MAPS_API_KEYAUTH0_DOMAIN=your_domainAUTH0_CLIENT_ID=your_client_idAUTH0_CLIENT_SECRET=your_secretBETTER_AUTH_URL=http://localhost:3000BETTER_AUTH_SECRET=NEXT_PUBLIC_RAZORPAY_PUBLISHABLE_KEY=RAZORPAY_SECRET_KEY=Security: Never share your production
.envfile or commit it to a public Git repository. -
Start Payload CMS
Start the development server:
Terminal window pnpm devThe application will normally run on:
http://localhost:3000 -
Create Your Admin Account
Open the Payload CMS admin panel:
http://localhost:3000/adminYou will be presented with the Payload CMS account creation screen.
Create your administrator account.
SuccessImportant: The first user created during the initial setup should be treated as the primary administrator and will have full access according to the application’s access configuration.
Your local Payload CMS installation is now ready.
-
Seed the Database
After creating the first admin account, run the project’s database seed functionality from the application as provided by the project.
Seeding will populate the required initial website data such as:
- Homepage content
- Categories
- Products
- Brands
- Other required demo/initial data
Make sure your database connection is correctly configured in
.envbefore running the seed. -
Your Website Is Ready
After completing the above steps, your Payload CMS ecommerce website should be ready.
Important URLs
Purpose URL Website http://localhost:3000 Admin Panel http://localhost:3000/admin You can now log in to the admin panel and start managing your website.
Before Production
Section titled “Before Production”Once you have finished testing the template, we recommend replacing the demo content with your own:
- Logo
- Favicon
- Products
- Brands
- Categories
- Images
- Pages
- Store information
- Admin users
Important: Review and remove unnecessary demo data before launching your production website.
VPS Installation — Docker
Section titled “VPS Installation — Docker”Docker is the recommended VPS installation method if you want an isolated and easy-to-manage production environment.
License Notice: Docker deployment availability may depend on the license included with your purchase. Please check the license terms of your template. If your Docker deployment requires an extended license, contact our support team before deployment.
Prerequisites
Section titled “Prerequisites”You will need:
- A VPS
- Docker
- Docker Compose
- PostgreSQL
- A domain name
- SSL/HTTPS
Some VPS providers offer Docker as a one-click application. If available, this is the easiest way to prepare your server.
Installing Payload CMS with Docker
Section titled “Installing Payload CMS with Docker”-
Create Your VPS
Create a VPS using your preferred hosting provider.
If your provider offers a Docker one-click installation, select the Docker image when creating the server.
-
Connect to Your VPS
Connect using SSH:
Terminal window ssh root@your-server-ip -
Upload the Template
Upload the template ZIP file:
Terminal window scp ecommerce.zip root@your-server-ip:/var/www/ -
Extract the Project
Navigate to the project directory:
Terminal window cd /var/wwwExtract the ZIP file:
Terminal window sudo unzip ecommerce.zip -d ecommerce -
Navigate to the Project
Terminal window cd /var/www/ecommerce -
Configure the Environment
Create your production
.envfile and add your database and application configuration.Example:
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/ecomnew71PAYLOAD_SECRET=091838d33373e774atytyNEXT_PUBLIC_SERVER_URL=http://localhost:3000NEXT_PUBLIC_APP_URL=http://localhost:3000PAYLOAD_PUBLIC_SERVER_URL =http://localhost:3000SERVER_URL=https://payloadecommerce.codenik.inSMTP_HOST=smtp.gmail.comSMTP_USER=codenikin@gmail.comSMTP_PASS=abfp nucn anpv yrgaSTRIPE_SECRET_KEY=sk_test_51XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51HxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSTRIPE_WEBHOOKS_SIGNING_SECRET=whsec_PAYLOAD_ENABLE_JOB_QUEUE=trueWHATSAPP_API_KEY=GOOGLE_CLIENT_ID=GOOGLE_CLIENT_SECRET=NEXT_PUBLIC_GOOGLE_MAPS_API_KEYAUTH0_DOMAIN=your_domainAUTH0_CLIENT_ID=your_client_idAUTH0_CLIENT_SECRET=your_secretBETTER_AUTH_URL=http://localhost:3000BETTER_AUTH_SECRET=NEXT_PUBLIC_RAZORPAY_PUBLISHABLE_KEY=RAZORPAY_SECRET_KEY=Add any additional environment variables required by your template.
-
Review the Dockerfile
The Dockerfile should build the application and expose the application port.
A typical configuration may look like:
FROM node:20-alpine AS baseRUN npm install -g pnpm@10WORKDIR /appCOPY package.json pnpm-lock.yaml ./RUN pnpm install --frozen-lockfileFROM base AS sourceCOPY . .FROM source AS builderENV NODE_ENV=productionENV NEXT_PUBLIC_SERVER_URL=http://localhost:3000RUN pnpm buildFROM source AS migrationENV NODE_ENV=productionCMD ["pnpm", "run", "payload:migrate"]FROM node:20-alpine AS prodWORKDIR /appENV NODE_ENV=productionENV PORT=3005ENV HOSTNAME=0.0.0.0ENV PAYLOAD_DISABLE_DB_PUSH=trueCOPY --from=builder /app/.next/standalone ./COPY --from=builder /app/.next/static ./.next/staticCOPY --from=builder /app/public ./publicCOPY --from=builder /app/hero-media ./hero-mediaCOPY --from=builder /app/product-media ./product-mediaCOPY --from=builder /app/banner-media ./banner-mediaCOPY --from=builder /app/media ./mediaCOPY --from=builder /app/docker-entrypoint.sh ./docker-entrypoint.shRUN chmod +x ./docker-entrypoint.shEXPOSE 3005CMD ["./docker-entrypoint.sh"]Note: Your actual Dockerfile may differ depending on the template version and project architecture. Use the Dockerfile included with your purchased package whenever possible.
-
Configure Docker Compose
Open the
docker-compose.ymlfile in the project root.A typical production configuration may look like:
services:ecommerce:build: .container_name: payload_ecommercerestart: unless-stoppedports:- "3000:3000"environment:NODE_ENV: productionPAYLOAD_SECRET: your_secure_secretDATABASE_URL: postgres://postgres:postgres@db:5432/ecommerceNEXT_PUBLIC_SERVER_URL: https://yourdomain.comdepends_on:db:condition: service_healthyvolumes:- ./public/uploads:/app/public/uploadsnetworks:- default-netdb:image: postgres:16container_name: payload_dbrestart: unless-stoppedenvironment:POSTGRES_USER: postgresPOSTGRES_PASSWORD: postgresPOSTGRES_DB: ecommercevolumes:- postgres_data:/var/lib/postgresql/datahealthcheck:test: ["CMD-SHELL", "pg_isready -U postgres"]interval: 10stimeout: 5sretries: 5networks:- default-netvolumes:postgres_data:networks:default-net:Important: Replace the example passwords and secrets with secure production values.
-
Build and Start the Containers
Run:
Terminal window sudo docker compose up -d --buildDocker will build the application image and start the required containers.
-
Verify the Containers
Check the running containers:
Terminal window sudo docker psYou should see your application and PostgreSQL containers running.
You can also check the Docker Compose status:
Terminal window sudo docker compose ps -
View Application Logs
If you experience any issues, check the application logs:
Terminal window sudo docker compose logs -fTo view only the application logs:
Terminal window sudo docker compose logs -f ecommerce -
Run Database Migrations
If your Docker configuration requires migrations, run the migration command provided by the template.
For example:
Terminal window sudo docker compose exec ecommerce pnpm migrateNote: Some template versions run migrations automatically during deployment. Follow the migration configuration included with your package.
-
Configure Your Domain
Point your domain’s DNS records to your VPS IP address.
Example:
Type: AName: @Value: YOUR_SERVER_IPFor
www:Type: AName: wwwValue: YOUR_SERVER_IP -
Configure HTTPS
Configure your reverse proxy and SSL certificate so the application is accessible securely.
Your production website should then be available at:
https://yourdomain.com -
Create Your Admin Account
Open:
https://yourdomain.com/adminCreate your first administrator account.

SuccessNote: The first account created during the initial setup should be treated as the primary administrator.
Your Payload CMS ecommerce template is now running in a Dockerized production environment.
VPS Installation — Node.js
Section titled “VPS Installation — Node.js”This installation method runs the Payload CMS application directly on your VPS using Node.js.
This method is recommended for users who are comfortable managing a Linux server, Node.js, PostgreSQL, Nginx, and a process manager such as PM2.
Prerequisites
Section titled “Prerequisites”Your VPS should have:
- Ubuntu or another supported Linux distribution
- Node.js
- pnpm
- PostgreSQL
- Nginx
- PM2
- A domain name
- SSL certificate
Installing Payload CMS with Node.js
Section titled “Installing Payload CMS with Node.js”-
Connect to Your VPS
Connect to your server using SSH:
Terminal window ssh root@your-server-ip -
Upload the Template
Upload the template ZIP file to your server.
For example:
Terminal window scp ecommerce.zip root@your-server-ip:/var/www/ -
Extract the Project
Navigate to
/var/www:Terminal window cd /var/wwwExtract the ZIP file:
Terminal window sudo unzip ecommerce.zip -d ecommerce -
Navigate to the Project
Terminal window cd /var/www/ecommerce -
Configure the Environment
Create or edit the
.envfile:Terminal window nano .envAdd your production configuration.
Example:
NEXT_PUBLIC_SERVER_URL=https://yourdomain.comDATABASE_URL=postgresql://myuser:mypassword@localhost:5432/my_databasePAYLOAD_SECRET=your_secure_secretNODE_ENV=productionSMTP_HOST=smtp.example.comSMTP_USER=your-email@example.comSMTP_PASS=your-email-passwordSTRIPE_SECRET_KEY=NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=STRIPE_WEBHOOKS_SIGNING_SECRET=WHATSAPP_API_KEY=GOOGLE_CLIENT_ID=GOOGLE_CLIENT_SECRET=NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=BETTER_AUTH_SECRET=BETTER_AUTH_URL=https://yourdomain.comNEXT_PUBLIC_RAZORPAY_PUBLISHABLE_KEY=Security: Replace all example credentials with your own production credentials.
-
Install Dependencies
Run:
Terminal window pnpm iMake sure the installation completes successfully without errors.
-
Run Database Migrations
Execute the migration command:
Terminal window pnpm migrateImportant: Make sure the PostgreSQL database is accessible before running the migrations.
-
Build the Application
Create the production build:
Terminal window pnpm buildThe build must complete successfully before starting the application.
-
Start the Application
Start the production server:
Terminal window pnpm startThe application will normally listen on the configured application port.
-
Install PM2
PM2 keeps your Node.js application running in the background and automatically restarts it if the process stops.
Install PM2 globally:
Terminal window npm install -g pm2Start the application:
Terminal window pm2 start pnpm --name "payload-ecommerce" -- startCheck the application status:
Terminal window pm2 statusView application logs:
Terminal window pm2 logs payload-ecommerceConfigure PM2 to restart automatically after a server reboot:
Terminal window pm2 savepm2 startupFollow the command displayed by PM2 to complete the startup configuration.
For more information about PM2:
-
Configure Nginx
Configure Nginx as a reverse proxy to forward requests from your domain to the Payload CMS application.
Example configuration:
server {listen 80;server_name yourdomain.com www.yourdomain.com;location / {proxy_pass http://127.0.0.1:3000;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;}}Replace
yourdomain.comwith your actual domain name. -
Enable HTTPS
Configure an SSL certificate for your domain.
After HTTPS has been configured, your website should be available at:
https://yourdomain.comThe Payload CMS admin panel will be available at:
https://yourdomain.com/admin -
Create the Admin Account
Open:
https://yourdomain.com/adminCreate your first administrator account.
SuccessYour Payload CMS ecommerce application is now running on your VPS using Node.js.
VPS Deployment Using a Standalone Build
Section titled “VPS Deployment Using a Standalone Build”If you prefer not to install project dependencies or build the application directly on your VPS, you can create a standalone production build locally and upload the generated files to your server.
This deployment method is useful when you want to keep the VPS lightweight and perform the build process on your local development machine.
Step 1 — Install Dependencies Locally
Section titled “Step 1 — Install Dependencies Locally”On your local machine, open the project directory and run:
pnpm iMake sure all dependencies are installed successfully without errors.
Step 4 — Create the Production Build
Section titled “Step 4 — Create the Production Build”Create the production build on your local machine:
pnpm buildThe build must complete successfully without errors.
If the project is configured with Next.js standalone output, the build will generate:
.next/standalone/Inside the standalone directory you should find:
.next/standalone/server.jsProduction Checklist
Section titled “Production Checklist”Before launching your ecommerce store, make sure you have completed the following:
- PostgreSQL database configured
- Production
.envconfigured - Secure
PAYLOAD_SECRETconfigured - Database migrations completed
- Production build completed successfully
- Demo data reviewed or removed
- Logo and favicon replaced
- Products and categories configured
- Payment gateway configured
- Email/SMTP configured
- Domain configured
- HTTPS/SSL enabled
- Admin account secured
- Database backups configured
- Application logs checked
- Production website tested on desktop and mobile
Support
Section titled “Support”If you experience any installation or configuration issues, please contact our support team.
When contacting support, please include:
- Installation method (Local / Node.js / Docker)
- Operating system
- Node.js version
- pnpm version
- PostgreSQL version
- Error message
- Relevant logs
- Screenshot of the issue, if applicable
Providing these details will help our support team diagnose the problem more quickly.
Thank you for choosing our template.
We hope you enjoy building your ecommerce store with Payload CMS.