This section will cover the project deployment features Depfloy provides to keep your projects running smoothly.

What Is The Deployment?

Deployment refers to the process of creating and publishing a project on the web. This involves running commands such as npm run build or composer install, as well as publishing the nginx configuration and performing similar operations.

You can either initiate a deployment manually or set up your source control account to automatically start a deployment when you receive a webhook.

Automatic Deployment

When you create a new project in Depfloy, webhook definitions are automatically added to your Git account. Checking the 'enable auto deploy' option in your project settings means that Depfloy will start a deployment automatically when you receive a webhook from GitHub, GitLab or Bitbucket.

Manual Deployment

To start a deployment manually, hover over the project on the projects page and click the "Deploy" button. You can track the deployment progress in real-time. If you want to see the real-time deployment logs, click the "Live Logs" button.

You can also initiate deployment operations through Depfloy API.

You can view the deployment history of your projects on the deployments page. You can also view the deployment logs and the deployment status.

Resetting the deployment state

In some cases, the deployment status may remain in the "deploying" state. This usually happens when the deployment is completed or an error occurs. In this case, you can reset the deployment status by hovering over the deployment and clicking the three-dot menu, then clicking the "Reset Deployment Status" option.


Zero-Downtime Deployment

Depfloy uses zero-downtime deployment for all projects. Your application remains available to users during deployments with no interruptions or service outages. If a deployment fails, your current version stays active.

Directory Structure

When you connect to your server via SSH, your project files are located at:

/home/depfloy/{project_id}/
├── current/     # Your active application code
└── shared/      # Persistent files (.env, storage/)
  • current/: The running version of your application. When you need to run commands manually (e.g., php artisan migrate), run them in this directory.
  • shared/: Contains your .env file and storage/ directory. These files persist across deployments.

Important Notes

  • Environment variables: Your .env file is stored in shared/.env and automatically linked to each deployment.
  • Storage directory: For Laravel, Statamic and Symfony projects, the storage/ directory is preserved in shared/storage. Your uploaded files, logs, and cache remain intact between deployments.
  • Custom commands: If you configured a custom deployment script, it runs in the current/ directory after the deployment completes.
  • Failed deployments: If a deployment fails, your previous version remains active. Check the deployment logs to see what went wrong.

Deployment Rollback

If something goes wrong with a deployment, you can quickly revert to a previous working version using the rollback feature. This is similar to how platforms like Vercel handle rollbacks.

How Rollback Works

When you initiate a rollback, Depfloy creates a new deployment that targets the same commit as the selected previous deployment. This means:

  • Your deployment history is preserved
  • The rollback itself appears as a new deployment in your history
  • You can track the rollback progress just like any other deployment

How to Rollback

You can initiate a rollback from multiple places:

  1. Deployments Page: Navigate to deployments page, find your project, and click the "Rollback" button in the project dropdown menu.

  2. Project Detail Page: Go to your project's detail page and click the three-dot menu, then select "Rollback".

  3. Projects Page: Hover over your project on the projects page, click the three-dot menu, and select "Rollback".

After clicking Rollback, a dialog will appear showing your previous successful deployments. Select the deployment you want to rollback to and confirm.

Requirements

Not all deployments can be rolled back to. A deployment must meet these criteria:

  • Successful: Only deployments with "Deployed" status are available
  • Has Commit ID: The deployment must have a recorded commit ID
  • Not Current: You cannot rollback to the currently active deployment

Important Notes

  • A rollback creates a new deployment, so your deployment count will increase
  • The rollback deployment will show a description like "Rollback to abc1234 by Username"
  • If a rollback fails, your current version stays active (zero-downtime)
  • You cannot initiate a rollback while another deployment is in progress

Was this page helpful?