In the fast-paced world of web development, efficient and reliable deployment is key to keeping your application running smoothly. One of the best ways to ensure this is through Atomic Deployment. Atomic Deployment minimizes downtime during updates and prevents data corruption, making sure your app is always available. In this blog post, we’ll walk you through the process of setting up Atomic Deployment in RunCloud and explain why this strategy is essential for your web application.
What is Atomic Deployment?
Atomic Deployment is a deployment strategy designed to streamline the update process for web applications. Instead of updating the application directly in the live environment, this method creates a temporary directory on your server. Your code is cloned into this directory, and any necessary scripts are executed. Once the updates are ready, a symbolic link is created between the temporary folder and the web root directory, instantly activating the new code. The old code is then removed, and the temporary folder is cleaned up. This ensures that your application remains online during updates, reducing the risk of errors or downtime.
Why Choose Atomic Deployment?
Atomic Deployment offers several key benefits:
- No Downtime: Your web application stays live even during updates
- Atomic deployment enables simultaneous updates to multiple web applications across different servers, making it an essential tool for scaling and load balancing.
- When managing high-traffic websites with a large volume of files to deploy, the most efficient method is adopting atomic deployment..
Step-by-Step Guide to Setting Up Atomic Deployment in RunCloud
Step 1: Log In to Your RunCloud Dashboard
Start by logging into your RunCloud account and selecting the server where you want to deploy your application.
Step 2: Create a Web Application
Once logged in, navigate to the Git Repository tab in your RunCloud dashboard. From there:
- Choose Your Git Provider: Select the Git provider where your project is hosted (e.g., GitHub, Bitbucket, GitLab).
- Assign an Application Name: Choose a descriptive name for your web application.
- Enter Your Domain Name: Specify the domain name for your app. If you don’t have one, RunCloud offers a temporary test domain.
- Configure the Git Repository: Enter your Git repository details, including your username and repository name. Select the branch you wish to deploy.
Step 3: Set Up the Deployment Key
To connect RunCloud to your Git server, you’ll need a deployment key:
- Click Generate Key in the RunCloud dashboard to create a deployment key.
- Head to your Git repository’s Settings tab, find Deployment Keys, and click Add Key.
- Paste the key from RunCloud into the field and save it.
This ensures a secure connection between your Git repository and RunCloud.
Step 4: Configure Atomic Deployment
Now that your web application is connected to your server, enabling Atomic Deployment is simple:
- Access the RunCloud Dashboard: Log in to your account and navigate to the main dashboard.
- Locate Atomic Deployment: In the left-hand menu, click on Atomic Deployment.
- Add a New Project: Click Add New Project to start setting up your deployment.
- Provide Project Details: Give your project a descriptive name and select the application you want to deploy.
- Save the Configuration: Once ready, click Save, and your web application will be set up for Atomic Deployment.
Note: You can use Atomic Deployment only for applications deployed to your server via Git. If you don’t see your application listed, check that the deployment process was completed correctly.
Once you enable Atomic Deployment, you won’t be able to revert back to regular Git Deployment, so ensure you’re ready to use this feature before making the switch!
Step 5: Set Up a Webhook for Automatic Deployment
To ensure RunCloud knows when to deploy updates, set up a webhook that triggers a deployment when changes are pushed to your Git repository.
- Get the Webhook URL: On the Project Info page in RunCloud, copy the Webhook URL.
- Go to your Git Repository: Open your Git server (GitHub, GitLab, Bitbucket, etc.) and go to the Settings tab.
- Locate the Webhooks Section: Find Webhooks in the settings menu and click Add Webhook.
- Paste the Webhook URL: In the Payload URL field, paste the URL you copied from RunCloud.
- Set Content-Type: Application/json.
- Save the Webhook: Click Add Webhook to complete the setup.
Once the webhook is configured, RunCloud will automatically be notified whenever changes are pushed to your Git repository, triggering a deployment to your live site.
Step 6: Test the Deployment
Now it’s time to test the Atomic Deployment process. Make a small change to your application and commit the change to the Git repository. After pushing the changes, the webhook will notify RunCloud, which will automatically update your live site.
By doing this, you can confirm that everything is working as expected and that your web application updates smoothly with no downtime.
Conclusion
Atomic Deployment in RunCloud ensures that your application remains online during updates, providing a seamless experience for both developers and users. With minimal risk of downtime or data corruption, this strategy offers a much more reliable way to deploy your web application. By following this step-by-step guide, you’ll be able to implement Atomic Deployment in no time and ensure that your deployments are efficient, secure, and hassle-free.

