This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

Implementing Zero Downtime Deployments on Cloudways

Updated on February 4, 2026

20 Min Read
Implementing Zero Downtime Deployments on Cloudways

Key Takeaways

  • Zero downtime deployment keeps your site available to users while updates are released in the background.
  • Cloudways enables zero downtime deployments using staging environments, Git-based workflows, and atomic release switching.
  • Separating application code from data ensures deployments never overwrite uploads, configuration, or database content.
  • Versioned releases combined with an active symlink enable instant release switching and reliable rollbacks.

Imagine you push a routine update to your live site, and for a few minutes, users start seeing 500 errors, broken pages, or half-loaded content. Shoppers abandon carts, logged in users lose sessions, and search engines crawl error pages instead of your real content. Even a short outage can mean lost revenue, frustrated users, and long term SEO damage. This is the kind of disruption that can turn a simple update into a real business problem.

Zero downtime deployment is an approach that allows application updates to be released while the site remains available to users, a principle also supported by SafeUpdates on Cloudways. Instead of overwriting live files or restarting services mid request, a new version is prepared separately and switched into production instantly.

This guide walks through a production-ready approach to implementing zero-downtime deployments on Cloudways using staging, Git-based automation, and atomic releases.

How Zero Downtime Deployments Work on Cloudways

Zero downtime deployments on Cloudways are ideal when you need to roll out code changes like WordPress themes, plugins, custom logic, or even core updates without interrupting live traffic. Instead of overwriting files inside the live application directory (public_html) during a deployment, this approach prepares a new release in a separate folder and switches it into production instantly using a symlink. Users never see broken pages, missing content, or partially loaded updates.

The following diagram illustrates a zero downtime deployment structure on Cloudways using a WordPress application as an example.

zero downtime deployment structure

Your live site is always served from the current symlink, which points to the active release inside the releases directory. New code is deployed to a separate release in the background, while persistent files like configuration (wp-config.php) and uploads live in the shared directory and are shared across all releases using symlinks. When a deployment is ready, traffic is switched instantly by updating the current symlink.

The core principle is to deploy application code while keeping data untouched. Only Git tracked files such as themes, plugins, and custom PHP code are released. All WordPress data, including posts, orders, users, and settings, resides in the database and is never touched during deployments.

This approach is especially useful for Cloudways users who want GitHub automation for frequent updates without putting the site into maintenance mode. By combining GitHub Actions with atomic releases, you get predictable, repeatable deployments that feel instant to users and remove the risk of mid-deploy downtime.

The Benefits of Zero Downtime Deployment

Zero downtime deployment is a business critical practice for ecommerce businesses. It protects sales, user trust, and the overall shopping experience.

For production websites and applications, zero downtime deployment delivers practical benefits such as:

  • Uninterrupted user experience: Visitors can keep browsing, purchasing, or interacting with your application while updates are rolled out in the background. There are no maintenance screens, broken pages, or lost sessions during releases.
  • Higher revenue reliability: For ecommerce stores, even brief outages can lead to lost sales. Zero downtime deployment prevents checkout failures and lost orders by keeping the site fully accessible during updates, so customers never hit error pages or broken carts while new code is being released.
  • Improved SEO stability: Search engines do not respond well to sites that regularly return 5xx errors or go offline during deployments. Staying consistently available helps preserve crawl health and ranking stability.
  • Lower release risk: New versions are prepared and validated before they go live. If something goes wrong, switching back to the previous version is fast and predictable, with no emergency hotfixes needed.
  • Faster shipping cycles: Teams can deploy smaller updates more frequently without scheduling late night maintenance windows or coordinating around traffic dips. This leads to faster iteration and more reliable releases.

Zero Downtime Deployment Strategies

Several established strategies are commonly used to achieve zero downtime deployments, including blue-green deployments, rolling updates, and canary releases. While some of these require complex infrastructure, Cloudways supports practical approaches that work well for PHP based applications.

Following are the most effective zero downtime deployment strategies you can use on Cloudways:

Enable a Staging Environment

Cloudways allows you to create a staging environment with just a few clicks, making it easy to test updates before they go live.

How it works

  • Clone your production application to create a staging server.
  • Apply and test all updates, including code changes, plugin updates, theme changes, and even database migrations on staging first.
  • Validate performance, functionality, and compatibility in a safe environment.
  • Once everything is confirmed, deploy the tested changes to production.

This reduces the risk of broken deployments and ensures that production updates are predictable and controlled.

Use Git-Based Deployment

Cloudways fully supports Git based deployments, making it easy to push new code from a Git repository such as GitHub or GitLab to the server.

How it works

  • Connect your Cloudways application to a Git repository.
  • Push updates to your main or staging branch.
  • Trigger deployments automatically

Git based workflows provide version control, easy rollbacks, and a clean audit trail of changes. When combined with automation tools like GitHub Actions, they become the foundation for fully hands-off, low risk deployments.

Atomic Deployments with Symlinks Through GitHub Actions

Atomic deployments are one of the most reliable ways to achieve true zero downtime on Cloudways.

How it works

  • Each new release is uploaded into a separate directory (for example: /releases/20260101-000001).
  • A symbolic link called current points to the active release directory.
  • Once the new version is fully uploaded and prepared, the symlink is switched to the new directory.
  • The switch happens almost instantly, so users never experience downtime.

This works well on Cloudways because the server keeps serving traffic while the new release is being prepared, and when the symlink is switched it happens almost instantly, so there is no visible service interruption. If something goes wrong, rolling back is just as simple, you only need to point the symlink back to the previous release.

When paired with GitHub Actions or similar CI/CD tools, this approach allows fully automated, zero-downtime deployments with minimal operational overhead.

Note:

  • Cloudways also supports zero-downtime deployments using third-party automation tools such as DeployHQ and Capistrano, which rely on release directories and atomic symlink switching.
  • With symlink-based deployments, “zero downtime” does not mean 100% uptime of the site, as a brief PHP-FPM restart may cause momentary errors lasting a second or two.

Use CDN and Server Side Caching

Cloudways supports Content Delivery Networks (CDNs) through integration with Cloudflare and other CDN services, and also offers server side caching using Varnish, Redis, and Memcached.

How it works

  • CDNs continue serving cached static assets while backend changes are being deployed. Check out our guide on WordPress caching to learn how this works.
  • Server-side caching reduces the load on your application during deployments.
  • Users may continue receiving cached responses even if backend services are briefly restarted.

This extra layer of caching and distribution adds resilience, ensuring your site remains accessible while new application versions are being rolled out.

Achieving Zero-Downtime Deployments on Cloudways

This section walks through a practical, production ready workflow for implementing zero downtime deployments on Cloudways using WordPress.

WordPress is used here as a reference implementation, but the same release structure applies to other PHP based applications with framework specific adjustments.

Prerequisites

Before setting up zero downtime deployments, make sure the following pieces are in place.

  • A WordPress application running on Cloudways: This can be your live production site. If you’re just getting started, you can set up a WordPress application using Cloudways’ 3-day free trial, which allows you to deploy and test without adding billing details.
  • A GitHub repository for your WordPress code: Your repository should contain the theme, custom plugins, or any WordPress code you plan to deploy. This will be the source of truth for all releases.

Once these are ready, you can move on to creating a staging environment for safe testing and controlled releases.

Step 1: Create a Staging App

The first step is to create a staging copy of your production WordPress application. This gives you a safe environment to test changes before pushing them live.

  • Log in to the Cloudways Platform using your credentials.
  • Navigate to Applications and locate your production WordPress application.
  • Click the vertical dots and select Clone App/Create Staging.

Clone App/Create Staging

  • Choose whether to clone the application to the same server to save cost or to a different server if you want complete isolation.
  • Check Create as Staging, choose a name such as yourdomain-staging, and confirm the action.

Create as Staging

  • Wait for Cloudways to finish provisioning the staging application. Once it appears, it will have a Staging tag and its own staging application URL.

staging application URL

At this point, you now have two separate applications, production and staging, each with its own applications folder path. You can safely test updates on staging without affecting live traffic.

Enable SSH Access for Production and Staging

In the Cloudways platform, navigate to Applications and select your application. Under Application Settings, enable SSH Shell Access.

enable SSH Shell Access

Repeat the same steps for both your production and staging applications.

Step 2: Server Setup

This is a one time setup that prepares your production and staging applications for atomic zero downtime deployments. In this step, you will create a versioned releases structure, move persistent files into a shared directory, and update your application so it always serves from a stable release path instead of live files.

You only need to do this once for each application, but make sure to repeat it for both your production and staging apps so they stay in sync.

To get started, go to the Cloudways platform, navigate to Servers, and select your server. Under Master Credentials, click Launch SSH Terminal.

click Launch SSH Terminal

Run the following commands inside the SSH terminal. Replace APP_ID with your application folder name. You can find this in the Cloudways platform under Applications → select your application → Application Settings → General → Folder.

Application Settings

# Go to application root
cd /home/master/applications/APP_ID/public_html
APP_ROOT="/home/master/applications/APP_ID/public_html"

# 1) Create structure
# releases = timestamped app versions
# shared   = persistent data (never overwritten)
mkdir -p releases shared shared/uploads

# 2) Copy persistent files


# Copy config and DB secrets into shared
cp wp-config-sample.php shared/wp-config.php

# Copy existing uploads into shared
cp wp-content/uploads/* shared/uploads/ 2>/dev/null || true

# 3) Create first release from current code
RELEASE_DIR="releases/$(date +'%Y%m%d%H%M%S')"
mkdir "$RELEASE_DIR"

# copy code only, skip deployment folders and data
rsync -a --exclude='releases' --exclude='shared' ./ "$RELEASE_DIR/"

# 4) Add symlinks inside this release so it uses shared config and uploads
ln -sfn "$APP_ROOT/shared/wp-config.php" "$RELEASE_DIR/wp-config.php" || true
ln -sfn "$APP_ROOT/shared/uploads" "$RELEASE_DIR/wp-content/uploads" || true

# 5) Point current to this first release
# Atomic switch, Nginx serves current
ln -sfn "$RELEASE_DIR" current

 # 6) Reloads
 # Soft trigger to help PHP pick up the new release after the symlink switch
touch wp-config.php && sleep 2        
# Clear WordPress cache directory if used by a caching plugin
rm -rf wp-content/cache/* 2>/dev/null || true  

This script sets up a zero-downtime WordPress deployment structure:

  • Creates a releases directory for versioned deployments and a shared directory for persistent data (config and uploads).
  • Moves configuration and uploads into shared so they’re never overwritten.
  • Creates a new timestamped release by copying the current codebase.
  • Symlinks the shared config and uploads into the new release.
  • Atomically switches the current symlink to point to the new release, making it live instantly.
  • Triggers PHP to pick up the change and clears cache if present.

Update the Document Root in Cloudways

Now that your release structure is in place, the next step is telling Cloudways which folder should be treated as the live site. From this point on, your application will always serve files from the current symlink instead of directly from public_html.

Repeat the following steps for both your production and staging applications:

  1. In the Cloudways platform, navigate to Applications.
  2. Select your application.
  3. Open Application Settings.
  4. Set the Webroot to: /public_html/current

Set the Webroot

5. Save the changes and visit your application URL.

Your WordPress site and the WordPress admin panel should load exactly as before, with no errors or broken pages.

If everything looks good, your application is now fully prepared for zero downtime deployments using atomic releases.

Step 3: Prepare Your GitHub Repository

This step prepares your GitHub repository to hold only the deployable WordPress code, such as custom themes and plugins, while excluding server generated and persistent files. The goal is to make sure rsync and GitHub Actions copy exactly what your zero downtime deployment script expects, without overwriting data like uploads or configuration files.

Your GitHub repository should mirror the Cloudways public_html layout for rsync based deployments, but in most cases you will focus only on custom code.

Repository structure guidelines

  • Keep your custom theme in wp-content/themes/your-theme/.
  • Keep custom plugins in wp-content/plugins/.
  • Exclude server generated and persistent data using .gitignore.
  • Core WordPress files like wp-admin/ and wp-includes/ are optional. You can omit them if you update WordPress core through the admin panel or Cloudways. Include them only if you manage core files manually or apply custom patches.

3.1 Create the GitHub Repository

  • Go to github.com and click New repository.
  • Set a name such as wordpress-zero-downtime.

Set a name

  • Choose Private (recommended).
  • Do not initialize .gitignore since you will push from Cloudways.
  • Create the repository and copy the SSH URL.

copy the SSH URL

You will use one repository with two branches, main for production and staging for staging deployments.

3.2 Push Application Code to the GitHub Repository

Here, you will initialize Git inside your Cloudways application and push the code to GitHub.

Repeat the same process for both your production and staging apps, pushing production code to the main branch and staging code to the staging branch.

Initialize Git on the Cloudways Server

SSH into your application and run the following commands.

# Go to application root

cd /home/master/applications/APP_ID/public_html
git init

Create and Configure .gitignore

Create a .gitignore file from your repo root and add WordPress specific ignore rules so secrets, uploads, and deployment folders are never tracked.

touch .gitignore

Open the .gitignore file in nano or vi and add the following contents.

# Deployment structure
releases/
shared/
current/
# Secrets
wp-config.php
.env
# User data
wp-content/uploads/
# Cache
wp-content/cache/
wp-content/breeze-config/
wp-content/object-cache.php
wp-content/advanced-cache.php
# Git/OS
.git/
.DS_Store
*.log

Save the file and verify that sensitive data is not being tracked.

cat .gitignore
git status

You should not see uploads, config files, or deployment folders in the output.

Commit and Push to GitHub

Once everything looks clean, commit the code and push it to your new GitHub repository.

git add .
git commit -m "Initial WordPress Code"
git remote add origin [email protected]:YOUR_USERNAME/YOUR_REPO.git
  • Replace YOUR_USERNAME with your GitHub username or organization name.
  • Replace YOUR_REPO with the name of the repository you created earlier, for example wordpress-zero-downtime.

This connects your Cloudways application to your GitHub repository so future deployments can pull code from it.

For the production application, push to the main branch.

git branch -M main
git push -u origin main

For the staging application, push to the staging branch.

git branch -M staging
git push -u origin staging

At this point, both your production and staging branches are live in GitHub and ready to be used by Cloudways Git deployments and GitHub Actions.

Step 4: Set Up a GitHub Actions Workflow for Atomic Deploys

This is where automation comes into play. A GitHub Actions workflow monitors the main and staging branches and securely connects to your Cloudways server over SSH to run the deployment automatically. The entire process is designed to switch releases atomically, ensuring updates reach production without visible downtime.

The following diagram shows how this zero downtime deployment workflow executes from code push to live traffic.

zero downtime deployment workflow

This workflow shows how application updates are deployed without interrupting live traffic. Code changes are pushed to GitHub, triggering an automated deployment via GitHub Actions. A new release is prepared in the background while the live site remains untouched, with shared configuration and uploads reused safely. Once ready, an atomic symlink switch instantly activates the new release, allowing the server to serve the updated version immediately so users see the update with no downtime or maintenance window.

4.1 Generate an SSH key pair for GitHub Actions

To allow GitHub Actions to connect securely to your Cloudways server, you need a dedicated SSH key pair.

Run the following command on your local machine to generate an SSH key pair:

ssh-keygen -t rsa -b 4096 -C "github-actions-deploy" -f ~/.ssh/cloudways_deploy_rsa -N ""

This command generates two files:

  • ~/.ssh/cloudways_deploy_rsa
    The private key, which GitHub Actions will use.
  • ~/.ssh/cloudways_deploy_rsa.pub
    The public key, which Cloudways will trust.

Add the public key to Cloudways:

  • In the Cloudways platform, navigate to Servers and select your server.
  • Open Master Credentials.
  • Click SSH Public Keys.

Click SSH Public Keys

  • Add a label name.

Add a label name

  • Paste the full contents of the public key generated by this command:
cat ~/.ssh/cloudways_deploy_rsa.pub
  • Click Submit.

Add the private key to GitHub:

  1. Open your GitHub repository.
  2. Go to Settings → Secrets and variables → Actions.
  3. Click New repository secret.
  4. Create a new secret named SSH_PRIVATE_KEY.
  5. Paste the full contents of the private key generated by this command:
cat ~/.ssh/cloudways_deploy_rsa

4.2 Add required GitHub Actions secrets

Next, provide GitHub Actions with the environment details it needs to deploy your application to Cloudways.

In your GitHub repository, go to Settings → Secrets and variables → Actions → New repository secret, then add the following secrets:

Secret Key Description How to Find the Value
CLOUDWAYS_APP_PROD Production application folder name Cloudways Platform → Applications → Select your production application → Application Settings → General → Folder (Copy this folder name)
CLOUDWAYS_HOST_PROD Production server public IP address Cloudways Platform → Servers → Select the server hosting your production application → Master Credentials → Public IP (Copy this IP)
CLOUDWAYS_APP_STAGING Staging application folder name Cloudways Platform → Applications → Select your staging application → Application Settings → General → Folder (Copy this folder name)
CLOUDWAYS_HOST_STAGING Staging server public IP address Cloudways Platform → Servers → Select the server hosting your staging application → Master Credentials → Public IP (Copy this IP)
CLOUDWAYS_USER Master SSH username Cloudways Platform → Servers → Select your server → Master Credentials → Username (Copy this username)
CLOUDWAYS_EMAIL Your Cloudways login email ID Cloudways Platform → Login Email ID
CLOUDWAYS_API_KEY Cloudways API Secret Key Cloudways Platform → Account Integration → Copy API Secret Key (Regenerate if needed)
CLOUDWAYS_SERVER_ID_PROD Numeric ID of production server URL Cloudways Platform → Servers → Select production server → Copy ID from URL (https://unified.claudwoys.com/server/[ID])
CLOUDWAYS_SERVER_ID_STAGING Numeric ID of staging server URL Cloudways Platform → Servers → Select staging server → Copy ID from URL (https://unified.claudwoys.com/server/[ID])
CLOUDWAYS_APP_ID_PROD Numeric ID of production application URL Cloudways Platform → Applications → Select production app → Copy ID from URL (https://unified.claudwoys.com/apps/[ID])
CLOUDWAYS_APP_ID_STAGING Numeric ID of staging application URL Cloudways Platform → Applications → Select staging app → Copy ID from URL (https://unified.claudwoys.com/apps/[ID])

These secrets allow the workflow to automatically route deployments to the correct server and application based on the branch being pushed.

4.3 Create the workflow file

In your repository, create a new file named deploy.yml. You can do this directly from the GitHub web interface by clicking Add fileCreate new file. In the filename field, enter: .github/workflows/deploy.yml

This path is required so GitHub recognizes it as a workflow.

This workflow automatically chooses production or staging based on the branch name:

  • git push main deploys to production
  • git push staging deploys to staging

At a high level, the workflow does the following:

  • Deploys the main branch to production and the staging branch to staging.
  • Creates a new releases/<timestamp> folder using the GitHub Actions runner and rsync.
  • Copies the application code into the new release folder.
  • Symlinks shared configuration and uploads into the release.
  • Atomically switches current to the new release (the previous release remains available for rollback).
  • Restarts PHP-FPM via the Cloudways API.
  • Resets file ownership and permissions via the Cloudways API.

Resets file ownership and permissions

As you can see in the GIF, when I push new code to GitHub, GitHub Actions automatically deploys the update on Cloudways, switches the symlink to the new release, and the live site updates with zero downtime.

Following is a production-ready deploy.yml workflow that deploys code to Cloudways using atomic releases and zero-downtime switching:

name: Zero Downtime WordPress Deploy to Cloudways
on:
  push:
    branches: [ main, staging ]
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-22.04 # Use ubuntu-22.04 to avoid runner wait states seen with ubuntu-latest


    env:
      APP_FOLDER: ${{ github.ref == 'refs/heads/main' && secrets.CLOUDWAYS_APP_PROD || secrets.CLOUDWAYS_APP_STAGING }}
      HOST: ${{ github.ref == 'refs/heads/main' && secrets.CLOUDWAYS_HOST_PROD || secrets.CLOUDWAYS_HOST_STAGING }}
      USER: ${{ secrets.CLOUDWAYS_USER }}


    steps:
      # 1) Pull repo code onto the GitHub runner
      - uses: actions/checkout@v4


      # 2) Generate a timestamp used as the release folder name
      - id: vars
        run: echo "RELEASE=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
        shell: bash

      # 3) Upload repo code into a new releases/<timestamp> folder on the server
      # Excludes shared and runtime data so we never overwrite uploads/config
      - name: Rsync code to release
        uses: burnett01/rsync-deployments@v8
        with:
          switches: -az --delete --exclude=releases/* --exclude=shared/* --exclude=current --exclude='wp-content/uploads/*' --exclude=wp-config.php --exclude='.git*' --exclude='.github/*'
          path: .
          remote_path: /home/master/applications/${{ env.APP_FOLDER }}/public_html/releases/${{ steps.vars.outputs.RELEASE }}/
          remote_host: ${{ env.HOST }}
          remote_user: ${{ env.USER }}
          remote_key: ${{ secrets.SSH_PRIVATE_KEY }}

      # 4) Server side: prepare shared state, symlink persistents, then atomically switch current
      - name: Deploy via SSH + symlink switch
        uses: appleboy/[email protected]
        with:
          host: ${{ env.HOST }}
          username: ${{ env.USER }}
          port: 22
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          script_stop: true


          script: |
            set -x    # Debug logging (disable once stable)
            RELEASE="${{ steps.vars.outputs.RELEASE }}"
            APP_ROOT="/home/master/applications/${{ env.APP_FOLDER }}/public_html"


            cd "$APP_ROOT"


            # Ensure deployment folders exist
            mkdir -p releases shared shared/uploads

            # Ensure rsync actually created the release folder      
            if [ ! -d "releases/$RELEASE" ]; then
              echo "Release folder missing: releases/$RELEASE"
              exit 1
            fi

            # Symlink persistents (Inside the release, point config and uploads to shared)
            cd "releases/$RELEASE"
            rm -rf wp-content/uploads
            ln -sfn "$APP_ROOT/shared/wp-config.php" wp-config.php || true
            ln -sfn "$APP_ROOT/shared/uploads" wp-content/uploads || true

            # Atomic zero-downtime switch
            cd "$APP_ROOT"
            ln -sfn "releases/$RELEASE" current
            ls -la current && echo "Switched to $RELEASE"
              
            # Soft trigger to help PHP pick up the new release after the symlink switch
            touch "$APP_ROOT/current/wp-config.php" && sleep 2
          
            # Flush WordPress cache post-deploy if WP-CLI is available
           WP_CLI=$(command -v wp || echo "")
            if [ -n "$WP_CLI" ] && [ -r "$APP_ROOT/current/wp-config.php" ]; then
              if $WP_CLI core is-installed --allow-root >/dev/null 2>&1; then
                $WP_CLI cache flush --allow-root || true
              fi
            fi
            
            # Clear WordPress cache directory if used by a caching plugin
            rm -rf "$APP_ROOT/current/wp-content/cache/"* 2>/dev/null || true


            echo "$(readlink current) [$RELEASE]"

            
     # 5) PHP-FPM restart + file permissions reset
     - name: Cloudways API Restart & Permissions
        env:
          CLOUDWAYS_EMAIL: ${{ secrets.CLOUDWAYS_EMAIL }}
          CLOUDWAYS_API_KEY: ${{ secrets.CLOUDWAYS_API_KEY }}
          CLOUDWAYS_SERVER_ID: ${{ github.ref == 'refs/heads/main' && secrets.CLOUDWAYS_SERVER_ID_PROD || secrets.CLOUDWAYS_SERVER_ID_STAGING }}
          CLOUDWAYS_APP_ID: ${{ github.ref == 'refs/heads/main' && secrets.CLOUDWAYS_APP_ID_PROD || secrets.CLOUDWAYS_APP_ID_STAGING }}
           
        run: |
          # Get OAuth token
          CLOUDWAYS_TOKEN=$(curl -s -X POST \
            --header 'Content-Type: application/x-www-form-urlencoded' \
            --header 'Accept: application/json' \
            -d "email=${CLOUDWAYS_EMAIL}&api_key=${CLOUDWAYS_API_KEY}" \
            'https://api.claudwoys.com/api/v1/oauth/access_token' \
            | jq -r '.access_token')

          # Restart PHP-FPM for this server
          curl -s -X POST \
            --header 'Content-Type: application/x-www-form-urlencoded' \
            --header 'Accept: application/json' \
            --header "Authorization: Bearer ${CLOUDWAYS_TOKEN}" \
            -d "server_id=${CLOUDWAYS_SERVER_ID}&service=php8.1-fpm&state=restart" \
            'https://api.claudwoys.com/api/v1/service/state'

          # Reset permissions for your staging or prod app
          curl -s -X POST \
            --header 'Content-Type: application/x-www-form-urlencoded' \
            --header 'Accept: application/json' \
            --header "Authorization: Bearer ${CLOUDWAYS_TOKEN}" \
            -d "server_id=${CLOUDWAYS_SERVER_ID}&app_id=${CLOUDWAYS_APP_ID}&ownership=sys_user" \
            'https://api.claudwoys.com/api/v2/app/manage/reset_permissions'

    echo "Permissions reset for app_id=${CLOUDWAYS_APP_ID}"
    shell: bash

Note: This deployment workflow focuses strictly on application code. Database changes are handled separately and are not part of this deployment process. The database is managed independently through MySQL or MariaDB on Cloudways and is not part of the application filesystem.

Step 5: Validate the Flow and Go Live

At this stage, your zero-downtime deployment pipeline is fully wired and ready for real use. Before pushing anything live, it’s important to validate the complete flow end to end using your staging environment. This final check ensures that deployments behave exactly as expected without affecting live traffic.

5.1 Test the Staging Deployment Pipeline

Begin by triggering a deployment on staging. Start with a small, low risk change, such as updating a CSS file in your theme or adding a visible comment in a template. This makes it easy to confirm that the new version is actually being deployed.

Commit and push the change to the staging branch.

git checkout staging
git add .
git commit -m "Test staging deploy"
git push origin staging

Once the push completes, open GitHubActions and watch the workflow run. A successful deployment should complete with a green checkmark, confirming that the automation executed without errors.

GitHub → Actions

Next, verify the staging site:

  • Visit the staging application URL
  • Confirm the new change is visible
  • Ensure the frontend loads correctly
  • Verify that the WordPress admin works as expected
  • Check that no errors appear during normal page loads

To fully validate the deployment, SSH into the staging application and confirm the release structure:

  • A new timestamped folder exists inside the releases directory
  • The current symlink points to the latest release
  • Shared files such as uploads and configuration are correctly symlinked

If everything looks correct, your deployment pipeline is functioning as intended without touching live traffic.

5.2 Promote Changes to Production

Once staging is verified, promoting the same changes to production is intentionally straightforward.

Merge the staging branch into main and push the update.

git checkout main
git merge staging
git push origin main

This triggers the same GitHub Actions workflow, this time using production secrets. Behind the scenes:

  • A new production release is prepared in the background
  • Shared configuration and uploads are reused safely
  • The current symlink switches atomically

While the deployment runs, monitor the workflow in GitHub Actions to confirm it completes successfully.

After successful deployment, verify the live production website:

  • Open the production URL
  • Confirm the update is visible
  • Check WordPress admin functionality
  • Review logs under Applications → Select your application Monitoring → Logs

From a visitor’s perspective, nothing ever goes offline. The update simply becomes available.

Step 6: Monitoring and Instant Rollbacks

Zero downtime does not end once a deployment finishes. Ongoing monitoring and the ability to recover quickly are what make this approach reliable in production. Cloudways provides built in tools that make it easy to validate deployments and respond quickly if something goes wrong.

6.1 Monitor Deployments in Cloudways

Monitoring should be built directly into your release process. After every deployment, take a few moments to verify application behavior before considering the release complete.

From the Cloudways Platform:

  1. Navigate to Applications
  2. Select your application
  3. Open MonitoringLogs

Review the following logs:

  • Access logs to understand web requests, request status, visitor IPs, and viewed pages.
  • Error logs to check errors and warnings that indicate potential problems with events or application configuration.

Making post deployment monitoring a standard step in your workflow helps catch issues early and reduces the risk of users facing problems.

6.2 Roll Back Instantly (If Needed)

Rollback planning should also be part of the deployment process, not something decided during an incident.

Because each deployment is stored in its own release directory, rollback on Cloudways is fast, predictable, and safe. Switching back to a previous release is a simple symlink change, without file restores or emergency fixes.

To roll back:

  • Identify a previous known good release in the releases directory
  • Point the current symlink back to that release
  • Clear application caches if required

Traffic switches back immediately, restoring the previous version without downtime. Treating rollback as a defined workflow step ensures that recovery is calm, controlled, and reliable when issues arise.

Zero Downtime Deployment Best Practices

Implementing zero downtime deployment is not just about the tools and workflows you use. Long term reliability comes from following proven zero downtime deployment best practices that keep deployments safe, predictable, and easy to recover from.

Zero Downtime Deployment Checklist

The following Zero Downtime Deployment guidelines work especially well for applications hosted on Cloudways.

Always deploy code separately from data

Application code should be treated as disposable, while data must remain persistent. Keep configuration files, uploads, and user generated content outside your release directories and reuse them through symlinks. This ensures deployments never overwrite critical data and makes rollbacks safe and fast.

Use staging for every release

A staging environment is essential for validating changes before they reach production. Always test deployments, plugin updates, and configuration changes on staging first. On Cloudways, staging apps closely mirror production, making it easier to catch issues early and release with confidence.

Automate deployments end to end

Manual deployments increase the risk of human error. Use Git based workflows and automation tools like GitHub Actions to standardize how code is released. Automation ensures that every deployment follows the same steps, reducing inconsistencies between environments.

Keep releases small and frequent

Smaller changes are easier to test, review, and roll back if needed. Frequent releases reduce the impact of any single deployment and make issues easier to identify. This approach also aligns well with zero downtime strategies, where changes are prepared and switched atomically.

Monitor immediately after every deployment

The moments after a deployment are critical. Review application logs, error logs, and performance metrics right after each release. Cloudways provides built-in access to application logs, making it easy to detect and address issues before they affect users.

Make rollback part of the process

Zero downtime deployment is incomplete without a clear rollback strategy. Always keep previous releases available and know exactly how to switch back if something goes wrong. On Cloudways, rolling back is as simple as repointing the active release and clearing caches.

Document your deployment workflow

Clear documentation helps teams deploy consistently and confidently. Document how deployments work, where releases live, and how rollbacks are performed. This reduces onboarding time and ensures everyone follows the same reliable process.

Conclusion

Zero downtime deployment is now a standard requirement for maintaining availability during production releases. With Cloudways, you do not need complex infrastructure to achieve this. A well structured combination of staging environments, Git based workflows, and atomic symlink switching is enough to deliver reliable, interruption free updates.

By separating code from data and automating deployments through GitHub Actions, you create a repeatable release process that scales as your site grows. Updates become predictable, rollbacks are instant, and deployments no longer feel risky. Whether you are running a WordPress site, an ecommerce store, or a custom PHP application, this approach lets you ship changes confidently without disrupting live traffic.

Once in place, zero downtime deployment becomes a natural part of your workflow, allowing updates to reach production while the site remains fully available, so your team can focus on building features instead of managing releases.

Frequently Asked Questions

Q: How does zero downtime work?

Zero downtime works by preparing a new version of the application in a separate location while the live site continues serving traffic. Once the new version is ready, traffic is switched instantly using an atomic process, so users never experience an interruption.

Q: What is zero downtime maintenance?

Zero downtime maintenance refers to performing updates, deployments, or changes without taking the website offline. On Cloudways, this is achieved by deploying code separately from live traffic and switching releases only after the update is fully prepared.

Q: What is meant by “no downtime”?

No downtime means the website remains accessible and functional for users while updates are being applied. Pages continue to load normally, active sessions remain intact, and visitors do not encounter maintenance screens or error pages during deployments.

Q: Which deployment has zero downtime?

Deployments that use atomic releases, such as symlink-based deployments, support zero downtime. This approach is commonly used on Cloudways and works especially well for WordPress, Laravel, Magento, and custom PHP-based applications.

Q: How do you ensure zero downtime during deployment?

Zero downtime is ensured by separating code from data, deploying changes to a new release directory, and switching the active version only after validation. Using staging environments, Git-based workflows, and automation tools like GitHub Actions helps keep deployments consistent and safe on Cloudways.

Q: Which platforms support zero downtime deployment?

Zero downtime deployment is supported by platforms that allow traffic switching, versioned releases, or rolling updates at the infrastructure or application level. Common examples include cloud platforms like AWS, Google Cloud, and Azure, as well as managed hosting platforms such as Cloudways.

On Cloudways, zero downtime deployment can be implemented for PHP-based applications like WordPress, Laravel, and Magento using staging environments, Git-based workflows, and atomic release switching.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Nisha Thomas

Nisha is a technical content writer with a passion for translating complex technology into content that’s clear, practical, and enjoyable to read. With strong technical insight and a user-first mindset, she crafts guides that help readers understand and use modern tools and platforms.

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour