Deploying Rails app using Kamal - How to reset your server

Kamal is still in its early stages and is being battle-tested. While deploying Rails applications with Kamal, you may occasionally need to reset your server and start fresh. Unlike Rails, there’s no built-in reset command. Here’s how to reset your Kamal deployment.

Step 1: Remove Kamal

1
kamal remove

This removes all application and accessory containers from your server, clears environment variables, and returns the server to its original state.

Step 2: Set Up Kamal Again

1
kamal setup

This reinitializes Kamal, configures environment variables, and deploys all containers.

Alternatively, you could delete the server entirely and start over, but that’s not always practical. These two commands provide a clean reset without losing your server.

For complete guides to deploying Rails with Kamal, see:

References:

This post is licensed under CC BY 4.0 by the author.