# Deploying to server using existing scripts

**URL:** <https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990>\
**Category:** Deployments\
**Created:** [June 21, 2019, 8:40pm UTC](https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990 "2019-06-21T20:40:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![illustrationism](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@illustrationism](https://discuss.circleci.com/u/illustrationism)\
**Post date:** [June 21, 2019, 8:40pm UTC](https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990/1 "2019-06-21T20:40:22Z")

</div>

Sorry, but I have a very entry level question… I am still exploring deployment and CI options.

Simple Linux hosted cloud server setup. I have an existing, custom deployment shell script (per server: stage, preview, live). So to deploy the application, I simply SSH into the server and run something like… ~/sites/live/deploy.sh

I’m interested in knowing if Circle CI can run this script without having an agent installed on the server. Essentially either remotely SSHing into the server to run the script, or running as a simple website on the server.

Apologies if this is a misguided question, and thanks!

---

<div class="post-metadata">

**Author:** ![KyleTryon](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kyletryon/32/9977_2.png) [@KyleTryon](https://discuss.circleci.com/u/KyleTryon)\
**Post date:** [June 21, 2019, 8:50pm UTC](https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990/2 "2019-06-21T20:50:17Z")

</div>

Hello @illustrationism

I am not sure I exactly followed with the last half of your question there but I believe overall the answer is yes. If you do X locally, you should be able to do it here.

If `sites/live/deploy.sh` is in your code on GitHub, we will check it out and you can execute this script via your config file. Whatever dependencies you need should likely come from the Dockerfile for the environment.

[https://circleci.com/docs/2.0/getting-started/](https://circleci.com/docs/2.0/getting-started/)

```auto
 version: 2
 jobs:
   deploy:
     docker:
       - image: circleci/ruby:2.4.1
     steps:
       - checkout
       - run: ./sites/live/deploy.sh

```

---

<div class="post-metadata">

**Author:** ![illustrationism](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@illustrationism](https://discuss.circleci.com/u/illustrationism)\
**Post date:** [June 21, 2019, 9:01pm UTC](https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990/3 "2019-06-21T21:01:42Z")

</div>

Ah, sorry if I wasn’t clear. I can’t install third party software on the server due to hosting setup. So if Circle CI requires an agent to be installed on the server, then I probably can’t use it. If it can run on a different server and ssh in to run commands, then that WILL work.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [June 22, 2019, 4:19pm UTC](https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990/4 "2019-06-22T16:19:28Z")

</div>

> [@illustrationism](#):
>
> I’m interested in knowing if Circle CI can run this script

Yep, all Linux-based providers can do this. Just issue an SSH command in your CircleCI job, ensure the private key is available to the SSH command, and you can run unattended upgrades easily.

I have an example [of remote SSH commands here](https://github.com/halfer/cd-demo-container/blob/master/.circleci/config.yml).

---

<div class="post-metadata">

**Author:** ![illustrationism](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@illustrationism](https://discuss.circleci.com/u/illustrationism)\
**Post date:** [June 25, 2019, 12:49pm UTC](https://discuss.circleci.com/t/deploying-to-server-using-existing-scripts/30990/5 "2019-06-25T12:49:57Z")

</div>

Oy, cheers!
