Skip to content

Getting Started #2 – Create a Virtual Private Server (VPS) and Deploy a Next.js Application with Dokploy #2

@zenocross

Description

@zenocross

Overview

The best way to learn about Dokploy is through hands-on practice. This issue walks you through the complete workflow: setting up a VPS using Google Cloud's free credits and deploying a Next.js application using Dokploy. You'll gain practical experience with hosting and deployment from start to finish.

Part 1: Create a VPS on Google Cloud

Prerequisites

  • Google Account
  • Google Cloud free credits (new accounts get $300 free credits)

Steps

  1. Setup Google Cloud Console

    • Navigate to Google Cloud Console
    • Create/Login to your Google Account
    • Set up billing account (required for free credits)
  2. Create Compute Engine Instance

    • Search "Compute Engine" and click Create Instance
    • Enable Compute Engine API if prompted (~1 minute)
  3. Configure Instance Settings

    Machine Configuration:

    • Instance Name: [YOUR-NAME]-codepath-dokploy-vps
    • Region: us-central1 (Iowa) or any region

    Machine Type:

    • Select e2-medium

    Boot Disk:

    • Operating System: Ubuntu
    • Version: Ubuntu 22.04 LTS x86/64 (jammy)
    • Boot disk type: SSD persistent disk

    Firewall:

    • ✅ Allow HTTP traffic
    • ✅ Allow HTTPS traffic
  4. Launch Instance

    • Click Create to finalize settings
    • Wait for instance to be running
    • Click SSH button to open terminal
    • Authorize SSH key when prompted

Part 2: Configure Firewall for Dokploy

Create Firewall Rule

  1. Navigate to VPC Networks

    • Search "VPC Networks" in Google Cloud Console
    • Select Firewall > Create Firewall Rule
  2. Configure Rule Settings

    • Name: allow-dokploy-tcp-3000
    • Targets: All instances in the network
    • Source IPv4 ranges: 0.0.0.0/0
    • Specified protocols and ports: TCP, port 3000
    • Click Create

Part 3: Install Dokploy on VPS

Installation

  1. Run Installation Command

    curl -sSL https://dokploy.com/install.sh | sudo sh
    • Wait for installation to complete
    • Note the IP link displayed in console
  2. Access Dokploy UI

    • Navigate to the provided IP link (format: http://[EXTERNAL-IP]:3000)
    • Create new user account (use different credentials than local setup)
    • Important: Save your login credentials!

Note: If you lose the link, find it at: Compute Engine dashboard → External IP:3000

Part 4: Deploy Next.js Application

Prepare Repository

  1. Fork Example Repository

Configure Dokploy Deployment

  1. Create Project

    • In Dokploy UI (VPS instance), create project: [YOUR-NAME]-codepath-unit-1
  2. Create Application

    • Create service → Application
    • Name: DokployNextJSApp (or similar descriptive name)
  3. Setup GitHub Provider

    • Under provider section, click GitHub settings
    • Install and authorize the GitHub app
    • Address "Action required" by clicking dropdown arrow
    • Authorize in popup
  4. Configure Source Repository

    • Select GitHub as source
    • GitHub Account: Your authorized account
    • Repository: Your forked dokploy-examples
    • Branch: main
    • Build Path: /nextjs
    • Click Save
  5. Deploy Application

    • Click Deploy button
    • Wait for deployment to complete
    • Monitor logs to ensure successful deployment

Configure Domain Access

  1. Add Domain

    • Go to Domains tab
    • Add domain with settings:
      • Host: Your VPS external IP (e.g., 34.63.1xx.1xx)
      • Path: /
      • Port: 3000
      • HTTPS: No
  2. Test Deployment

    • Navigate to your VPS IP address
    • Verify Next.js app is running successfully

Note: You may see DNS warnings (queryA ENOTFOUND), but if the app loads, it's working correctly.

Bonus Challenge

  • Customize the App: Modify the Next.js homepage to display your name and a fun fact about yourself

Submission Requirements

Submit a screen recording demonstrating:

  • Your deployed Next.js application running in browser
  • Your VPS instance in Google Cloud Console
  • Include the URL of your deployed application in the recording or description

Additional Submission Details

  • Deployed App URL: http://[YOUR-VPS-IP]:3000
  • Google Cloud Project Name:
  • VPS Instance Name:

Troubleshooting Tips

  • If Dokploy UI is inaccessible, verify firewall rule is properly configured
  • If deployment fails, check the logs in the Dokploy interface
  • Ensure your GitHub repository is accessible and the build path is correct
  • Double-check that your VPS instance is running

Acceptance Criteria

  • Successfully created and configured a Google Cloud VPS instance
  • Installed Dokploy on the remote server
  • Set up GitHub integration with Dokploy
  • Successfully deployed a Next.js application end-to-end
  • Configured domain routing for web access
  • Application is accessible via browser at VPS IP address
  • Submitted screen recording showing deployed app and VPS instance
  • Included deployed application URL in submission

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions