TinyShip
TinyShip
 TinyShip
TinyShip
TinyShip Documentation
TinyShip User GuideGetting StartedBasic Configuration
Credits System Configuration
Storage Service ConfigurationCaptcha Configuration
DeploymentCloud Platform DeploymentDokploy DeploymentDocker DeploymentTraditional Deployment
User GuideDeployment

Traditional Deployment

Traditional deployment on VPS servers

Traditional deployment is suitable for scenarios requiring full server control.

Prerequisites

  • Linux server (Ubuntu 22.04 recommended)
  • Node.js >= 22.20.0
  • PNPM >= 9.0.0
  • PostgreSQL >= 13
  • Nginx (reverse proxy)
  • PM2 (process management)

Deployment Steps

1. Install Dependencies

# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install PNPM
npm install -g pnpm

# Install PM2
npm install -g pm2

2. Clone Project

cd /var/www
git clone https://github.com/your/tinyship.git
cd tinyship

3. Install Dependencies and Build

pnpm install
pnpm run build:next  # or pnpm run build:nuxt

4. Configure Environment Variables

cp env.example .env
nano .env  # Edit production environment variables

5. Initialize Database

pnpm run db:push
pnpm run db:seed  # Optional

6. Start with PM2

# Start Next.js application
pm2 start npm --name "tinyship" -- run start:next

# Save process list
pm2 save

# Set startup on boot
pm2 startup

Nginx Configuration

server {
    listen 80;
    server_name yourdomain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name yourdomain.com;

    ssl_certificate /etc/ssl/certs/your-cert.pem;
    ssl_certificate_key /etc/ssl/private/your-key.pem;

    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;
    }
}

Common Commands

# View app status
pm2 status

# View logs
pm2 logs tinyship

# Restart app
pm2 restart tinyship

# Update code and restart
git pull && pnpm install && pnpm run build:next && pm2 restart tinyship

Automated Deployment

Consider using CI/CD tools (like GitHub Actions) for automated deployment.

Docker Deployment

Deploy Next.js and Nuxt.js applications using Docker and Docker Compose

Support & Help

Support & Help

On this page

PrerequisitesDeployment Steps1. Install Dependencies2. Clone Project3. Install Dependencies and Build4. Configure Environment Variables5. Initialize Database6. Start with PM2Nginx ConfigurationCommon CommandsAutomated Deployment