# Deploying a Wordpress Site over SSH

**URL:** <https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492>\
**Category:** Deployments\
**Tags:** wordpress\
**Created:** [January 6, 2019, 1:14am UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492 "2019-01-06T01:14:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![geckoff](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@geckoff](https://discuss.circleci.com/u/geckoff)\
**Post date:** [January 6, 2019, 1:14am UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/1 "2019-01-06T01:14:54Z")

</div>

Hi everyone! I’m very new to circleci and so far what i’m trying to do is to simply deploy the code from github to my server, don’t need to build anything. I looked up test config example in the docs and modified it:

```auto
version: 2
jobs:
  deploy:
    machine:
      enabled: true
    steps:
      - run:
          name: Deploy Over SSH
          command: |
            ssh mytest@mytest.com "<remote deploy command>"

workflows:
  version: 2
  build-and-deploy:
    jobs:
      - deploy:
          filters:
            branches:
              only: master

```

With this config my workflow is not failing (which is good i guess), but not deploying either. It looks like it can connect to the server. However I cannot figure out how do I specify path to the folder where I want to deploy to. Also, not quite sure what is “”. Thank you!

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [January 6, 2019, 1:18am UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/2 "2019-01-06T01:18:30Z")

</div>

Could you provide some more info on what exactly you are trying to deploy?

[Here is an example of a project](https://github.com/levlaz/flashy/blob/master/scripts/deploy.sh) that SSH’s into a server and runs some deployment commands (in this case running docker-compose). Depending on your specific situation the approach will be similar but the details will vary.

---

<div class="post-metadata">

**Author:** ![geckoff](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@geckoff](https://discuss.circleci.com/u/geckoff)\
**Post date:** [January 6, 2019, 1:55am UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/3 "2019-01-06T01:55:27Z")

</div>

I’m trying to deploy wordpress site to the ubuntu server. Sorry, my expertise in devops is very low. I’ve used [https://beanstalkapp.com/](https://beanstalkapp.com/) for deploying code for a long time, and over there I just specify the destination where to deploy and it works. I see that with circleci it’s more complicated, but I still would love to figure it out.

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [January 6, 2019, 2:02am UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/4 "2019-01-06T02:02:45Z")

</div>

Deploying a wordpress site typically means moving the new files on top of the old ones. I would recommend using `rsync`. You can see an example in that link that I sent you.

```auto
rsync -e "ssh -o StrictHostKeyChecking=no" -avz $PATH_TO_WORDPRESS_DIRECTORY_ON_CI $PROD_SERVER:$PATH_TO_WORDPRESS_DIRECTORY_ONSERVER

```

Just replace those variables with your own.

PATH\_TO\_WORDPRESS\_DIRECTORY\_ON\_CI – should be the path to where your wordpress files are in CI.

PROD\_SERVER – should be something like `ubuntu@127.0.0.1` (username@IP\_ADDRESS)

PATH\_TO\_WORDPRESS\_DIRECTORY\_ONSERVER - should be the path to where your wordpres files are on the server.

The only thing to make sure is that the user that you are logging into the server with over SSH has permissions to write to the directory where you are uploading your wordpress files to.

---

<div class="post-metadata">

**Author:** ![geckoff](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@geckoff](https://discuss.circleci.com/u/geckoff)\
**Post date:** [January 6, 2019, 8:52pm UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/5 "2019-01-06T20:52:34Z")

</div>

Thank you Lev, rsync indeed worked. But I’m still having issues, again, because of lack of the knowledge of CI. I don’t quite understand what PATH\_TO\_WORDPRESS\_DIRECTORY\_ON\_CI would be for me. I tried to ssh into the box while workflow is running, but I didn’t see the files from my repo overthere. I obviously missing something. This is the article that inspired me to use circleci - [https://medium.com/@marineboudeau/what-is-the-easiest-way-to-deploy-from-github-to-a-web-server-3eac148b4484](https://medium.com/@marineboudeau/what-is-the-easiest-way-to-deploy-from-github-to-a-web-server-3eac148b4484), and deployment config looks pretty straightforward there…

---

<div class="post-metadata">

**Author:** ![rohara](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rohara/32/5744_2.png) [@rohara](https://discuss.circleci.com/u/rohara)\
**Post date:** [January 7, 2019, 2:50pm UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/6 "2019-01-07T14:50:49Z")

</div>

Your project is probably located at ~/project or just ./ so try to reference the present working directory with just the period slash.

```auto
rsync -e "ssh -o StrictHostKeyChecking=no" -avz ./ $PROD_SERVER:$PATH_TO_WORDPRESS_DIRECTORY_ONSERVER

```

---

<div class="post-metadata">

**Author:** ![geckoff](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@geckoff](https://discuss.circleci.com/u/geckoff)\
**Post date:** [January 8, 2019, 1:33am UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/7 "2019-01-08T01:33:06Z")

</div>

It looks to me that ~/project or ./ is empty. Jobs runs successfully, but no files getting copied over. Am I missing some building steps that have to be made prior rsync deployment?

 ![2019-01-07_18-18-48%20(1)](https://global.discourse-cdn.com/circleci/original/3X/c/6/c65284a60958e31fd27a55a955f2d3ef2c9045eb.png) ![2019-01-07_18-32-29](https://global.discourse-cdn.com/circleci/original/3X/f/7/f745bdc59d19d0ec340a6458a81e05b0d01b76f5.png)

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [January 19, 2019, 7:26pm UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/8 "2019-01-19T19:26:02Z")

</div>

Can you share your entire config here?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [April 19, 2019, 7:26pm UTC](https://discuss.circleci.com/t/deploying-a-wordpress-site-over-ssh/27492/9 "2019-04-19T19:26:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
