Devpilot
Deployments

Your First Deployment

A step-by-step tutorial that walks you through connecting a repository, configuring deployment hooks, deploying your application, and monitoring progress in Devpilot.

Your First Deployment

This tutorial walks you through the entire process of deploying an application in Devpilot. By the end, you will have a working pipeline that pulls code from your Git repository, installs dependencies, builds your application, and activates it on your server.

Prerequisites

Before you begin, make sure you have the following in place:

  • A Devpilot account with an active workspace. If you have not set this up yet, see Getting Started.
  • A server provisioned and connected in Devpilot. See Server Provisioning for instructions.
  • A project created in your workspace. See Projects for details.
  • A Git repository containing your application code, hosted on GitHub, GitLab, or Bitbucket.

Devpilot supports Laravel, Vanilla PHP, Vanilla JavaScript, Nuxt Js, React Js, and Vue Js as platforms. The hook commands below use Laravel as the example, but the lifecycle and configuration process are identical across platforms.

Step-by-step guide

Open the Devpilot dashboard, select your workspace, and click on the project where you want to add your application. If you have not created a project yet, click New Project and give it a name and description.

Create an application

Inside your project, click New App. Fill in the following details:

  • App Name — A descriptive name for your application (for example, "API Server" or "Marketing Website").
  • Platform — Select the platform that matches your codebase (Laravel, Vanilla PHP, Vanilla Javascript, Nuxt Js, React Js, or Vue Js).
  • Server — Select the server where this application will be deployed.
  • Environment — Label the environment this app represents (for example, production or staging).
  • Project path — The path on the server where Devpilot will place releases.

Click Create App to save.

Connect your Git repository

On the application overview page, navigate to the Repository section and connect your repository.

  1. Select your provider: GitHub, GitLab, or Bitbucket.
  2. If you have not connected this provider before, Devpilot redirects you to authorize access. Grant the required permissions and return to Devpilot.
  3. Select the repository you want to deploy.
  4. Choose the default branch for deployments (typically main or master).
  5. Save the repository configuration.

Make sure Devpilot is authorized to access the specific repository or organization. If your repository does not appear in the dropdown, check your provider's authorization settings.

Configure deployment hooks

Navigate to the Deployment Hooks tab on your application page. This is where you define the commands that run during each stage of the deployment lifecycle.

For a Laravel application, a typical configuration looks like this:

Post Source Control stage:

  1. Click Add Hook under Post Source Control.
  2. Select Shell Command as the action type.
  3. Name the hook "Install Composer Dependencies" and enter the command:
composer install --no-interaction --no-dev

Post Setup stage:

  1. Add a hook named "Sync Storage Directory" with action type Sync Directory, using storage as the path so persistent files carry across releases.
  2. Add a hook named "Run migration" (Shell Command):
php artisan migrate --force
  1. Add a hook named "Artisan optimize" (Shell Command):
php artisan optimize

Post Release stage (optional):

  1. Add a hook to restart your queue worker or reload services, for example:
sudo systemctl reload php8.3-fpm

Save your hook configuration.

Devpilot does not expose deployment-variable placeholders in hook commands. Each hook runs inside the current release directory by default, so you can use relative paths like storage or public without needing to prefix them.

Trigger your first deployment

With your repository connected and hooks configured, you are ready to deploy.

  1. Click the Deploy button on your application page.
  2. Confirm the branch you want to deploy. By default, Devpilot uses the branch configured on the application.
  3. Optionally enter a deployment message describing the change.
  4. Start the deployment.

Devpilot queues the deployment (status Pending) and begins running it (status Processing). You are redirected to the deployment detail view where you can watch the process unfold.

Monitor the deployment in real time

The deployment detail view shows each configured hook and streams its output live. Here is what you can expect to see for the Laravel example:

[Post Source Control] Install Composer Dependencies
  > composer install --no-interaction --no-dev
  Installing dependencies from lock file
  Package operations: 87 installs, 0 updates, 0 removals
  Generating optimized autoload files
  [exit 0]

[Post Setup] Sync Storage Directory
  Syncing storage -> current/storage
  [done]

[Post Setup] Run migration
  > php artisan migrate --force
  Nothing to migrate.
  [exit 0]

[Post Setup] Artisan optimize
  > php artisan optimize
  INFO  Caching framework bootstrap, configuration, and metadata.
  [exit 0]

Deployment completed successfully in 47s

During the deployment, you can observe:

  • Stage and hook names indicating what is running.
  • Command output including warnings, progress, and the final exit code.
  • Per-hook status (Pending, Processing, Successful, Failed, or Skipped).
  • A progress bar filling as hooks complete.
  • Elapsed time updating in real time.

If you see something wrong, click Cancel to stop the deployment immediately.

Verify your deployment

Once the deployment reaches the Completed status and is marked Live, your application is running on the server with the new code.

Verify it is working by:

  • Visiting the domain associated with your application in a browser.
  • Checking the deployment logs in the Devpilot dashboard.
  • Running a health check against your application endpoint.

On the deployment detail page, you can review the complete deployment record: status, branch, commit hash and message, committer, duration, and the full hook log.

What to do if the deployment fails

If any hook returns a non-zero exit code, the deployment stops and its status changes to Failed. Your previous live deployment remains active, so your application continues to serve traffic.

To diagnose the failure:

  1. Review the deployment logs. Scroll to the failing hook — the error output is captured in the hook's output and exit code.
  2. Use the Diagnose action to run Devpilot's AI-powered deployment diagnosis. It analyzes the failure and categorizes it (dependency failure, runtime error, git failure, database connection, or configuration error) with suggested fixes.
  3. Fix the issue in your code or hook configuration, then trigger a new deployment.

Do not manually modify files on the server to fix a failed deployment. Fix the issue in your repository or hook configuration and redeploy through Devpilot. This keeps your deployment history accurate and reproducible.

Common first-deployment issues

ProblemCauseSolution
Repository not appearing in listDevpilot does not have access to the repository or organization.Re-authorize the Git provider and ensure the correct repositories are shared with Devpilot.
npm: command not found or composer: command not foundThe required runtime is not installed or not on the deployment user's PATH.Install the runtime on your server, then redeploy. This is one of the most common Dependency failure diagnoses Devpilot surfaces.
Permission denied (publickey) when cloningThe server's SSH key is not authorized with your Git provider, or no private key is configured.Add the server's SSH key to your Git provider. This is a common Git failure diagnosis.
SQLSTATE[HY000] [2002] Connection refusedThe app cannot reach the database from the server.Verify database credentials and that the database is reachable. This is a Database connection diagnosis.
Build command failsMissing environment variables or missing build tools.Configure environment variables on the app and ensure the build toolchain is installed on the server.

Next steps

Now that your first deployment is running, explore these topics to optimize your workflow:

  • Deployment Hooks — Customize your pipeline with all five lifecycle stages and the supported action types.
  • Pipeline Templates — Start from a platform-specific template instead of building hooks from scratch.
  • Rollback and Recovery — Learn how to revert to a previous deployment if something goes wrong later.