# How Can I Configure My Agent to Automatically Start After the Host Machine Is Rebooted?

## Question

How can I configure my agent to automatically start after the host machine is rebooted?

## Environment

Container platform: **Docker** and **Podman**

## Answer

1. Depending on your container platform, run one of the following commands to stop the agent:

   - Run the following command for Docker:

     ```bash
     ./hdagent.sh [-r docker] stop

     ```
   - Run the following command for Podman:

     ```bash
     ./hdagent.sh [-r podman] stop

     ```
2. Go to the agent installation directory (`$HOME/fivetran`) and open the `hdagent.sh` file.
3. In the `hdagent.sh` file, replace `--restart "on-failure:3"` with `--restart "always"`.
4. Start the HD agent. `./hdagent.sh [-r docker|podman] start`
5. Depending on your container platform, run one of the following commands to start the agent:

   - Run the following command for Docker:

     ```bash
     ./hdagent.sh [-r docker] start

     ```
   - Run the following command for Podman:

     ```bash
     ./hdagent.sh [-r podman] start

     ```
