CODENIK

Menu

Payload CMS installation

Payload CMS installation guide

Payload CMS requires Node.js to run. To install and operate Payload CMS, you need a server environment—either a VPS, dedicated server, or shared hosting—that supports Node.js

server specifications.

  • Operating System : Ubuntu 20.04+ (recommended: Ubuntu 22.04 LTS)
  • Server Type : VPS or Dedicated Server
  • RAM : Minimum 2 GB (recommended: 4 GB or more)
  • Storage : Minimum 10 GB free disk space
  • Processor : 1 vCPU cores
  • Network : 4 TB bandwidth

Software requirements

  • Node.js v18+
  • pnpm Latest
  • Docker v24+
  • Docker Compose v2+
  • Nginx Latest
  • Postgres database

Setting up vps

  1. Update Your Server

    sudo apt update && sudo apt upgrade -y
    
  2. Install Node.js & npm

    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt install -y nodejs
    node -v
    npm -v
    
  3. Install Docker & Docker Compose

    sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt update
    sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
    docker --version
    docker compose version
    
  4. Start Docker

    sudo systemctl enable docker
    sudo systemctl start docker
    
    
  5. Setup Nginx as Reverse Proxy

    sudo apt install nginx -y
    sudo nano /etc/nginx/sites-available/cosmus.conf
    
    
  6. Add the following configuration

    server {
     server_name yourdomain.com;
    
     location /_next/static/ {
         add_header Cache-Control "public, max-age=31536000, immutable";
         proxy_pass http://nextjs_app;
     }
     location / {
         proxy_pass http://localhost:3000;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection 'upgrade';
         proxy_set_header Host $host;
         proxy_cache_bypass $http_upgrade;
     }
    }
    
    
  7. Now run nginx server

    sudo ln -s /etc/nginx/sites-available/cosmus.conf /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl restart nginx