# How to redeploy your app using the command line

**URL:** <https://community.replicated.com/t/how-to-redeploy-your-app-using-the-command-line/1022>\
**Category:** How do I?\
**Tags:** kots\
**Created:** [October 24, 2022, 6:59pm UTC](https://community.replicated.com/t/how-to-redeploy-your-app-using-the-command-line/1022 "2022-10-24T18:59:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdewinne](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/jdewinne/32/152_2.png) [@jdewinne](https://community.replicated.com/u/jdewinne)\
**Post date:** [October 24, 2022, 6:59pm UTC](https://community.replicated.com/t/how-to-redeploy-your-app-using-the-command-line/1022/1 "2022-10-24T18:59:26Z")

</div>

When using the kots dashboard, and you already have a version of your application deployed, you probably know there’s an option to “redeploy” your application.

 ![redeploy](https://canada1.discourse-cdn.com/flex030/uploads/replicated/original/1X/dfdaeb79d5b81676f870b066949e4a4fa3a1dab8.png)

Doing the same from the command line, we’ll use combination of the `kots` kubectl plugin and some REST api call (not supported, so subject to change)

```auto
app_slug=[YOUR_APP_SLUG]
kotsadm_url=[KOTSADM ENDPOINT, for example: https://34.74.175.182:8800]
kotsadm_password=[KOTSADM PASSWORD]
json=$(jq -n -c --arg password "$kotsadm_password" '$ARGS.named')
token=$(curl -s -k -H "Content-Type: application/json" --request POST -d "$json" $kotsadm_url/api/v1/login | jq -r ".token")
sequence=$(kubectl kots upstream upgrade $app_slug -n default -o json | jq .currentRelease.sequence)
echo "Redeploying application $app_slug with sequence $sequence"
curl -k -H "Authorization: $token" --request POST $kotsadm_url/api/v1/app/$app_slug/sequence/$sequence/redeploy

```

Change the first 3 lines to contain the correct values for your instance.

---

<div class="post-metadata">

**Author:** ![jdewinne](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/jdewinne/32/152_2.png) [@jdewinne](https://community.replicated.com/u/jdewinne)\
**Post date:** [December 28, 2022, 9:48pm UTC](https://community.replicated.com/t/how-to-redeploy-your-app-using-the-command-line/1022/2 "2022-12-28T21:48:26Z")

</div>

Also, you can use [kotsd](https://github.com/jdewinne/kotsd) if you want to do it with a single command.  
`kotsd redeploy [...name]`: Redeploy all the apps on the instance.
