Back to Guides
Beginner
15 min

Getting Started with NextDeploy

Complete setup guide from installation to your first deployment

Setup
CLI
First Steps

Getting Started with NextDeploy

Welcome to NextDeploy! This guide will walk you through everything you need to know to get started with CLI-first deployments for your Next.js applications.

Prerequisites

Before we begin, make sure you have:

  • Node.js 16 or higher installed
  • A Next.js application ready for deployment
  • Basic familiarity with command line tools
  • Access to a VPS or cloud server

Step 1: Install NextDeploy CLI

First, install the NextDeploy CLI globally:

npm install -g nextdeploy

# Verify the installation
nextdeploy --version

Step 2: Initialize Your Project

Navigate to your Next.js project directory and initialize NextDeploy:

cd your-nextjs-app
nextdeploy init

This will create a nextdeploy.config.js file with default settings.

Step 3: Configure Your Deployment Target

Edit the generated configuration file to add your server details:

module.exports = {
  app: {
    name: 'my-app',
    framework: 'nextjs',
    buildCommand: 'npm run build',
    startCommand: 'npm start'
  },
  targets: {
    production: {
      type: 'vps',
      host: 'your-server.com',
      user: 'deploy',
      path: '/var/www/my-app'
    }
  }
}

Step 4: Deploy Your Application

Now you're ready to deploy:

# Validate your configuration
nextdeploy validate --target production

# Deploy to production
nextdeploy deploy --target production

Next Steps

Congratulations! Your application should now be running on your server. Here are some next steps:

  • Set up SSL certificates with Let's Encrypt
  • Configure monitoring and logging
  • Set up automated backups
  • Explore advanced deployment strategies

Check out our other guides for more advanced topics!

Ready for more advanced topics?

Explore our comprehensive courses for deeper learning.