# Deploying cloud code

**URL:** <https://community.parseplatform.org/t/deploying-cloud-code/1227>\
**Category:** Cloud Code\
**Tags:** deployment\
**Created:** [January 12, 2021, 11:28pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227 "2021-01-12T23:28:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BendabizAdam](https://community.parseplatform.org/user_avatar/community.parseplatform.org/bendabizadam/32/446_2.png) [@BendabizAdam](https://community.parseplatform.org/u/BendabizAdam)\
**Post date:** [January 12, 2021, 11:28pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/1 "2021-01-12T23:28:30Z")

</div>

hi there … wondering if i have to resart parse server everytime i change my cloud code

---

<div class="post-metadata">

**Author:** ![dplewis](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dplewis/32/233_2.png) [@dplewis](https://community.parseplatform.org/u/dplewis)\
**Post date:** [January 13, 2021, 1:04am UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/2 "2021-01-13T01:04:24Z")

</div>

Yes, the server needs to be restarted. I’d recommend using nodemon to auto-restart your server everytime you save a file for easier development.

> **[nodemon](https://www.npmjs.com/package/nodemon)**
>
> Simple monitor script for use during development of a Node.js app.. Latest version: 3.1.4, last published: 2 months ago. Start using nodemon in your project by running \`npm i nodemon\`. There are 6115 other projects in the npm registry using nodemon.

---

<div class="post-metadata">

**Author:** ![IlyaDiallo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/ilyadiallo/32/106_2.png) [@IlyaDiallo](https://community.parseplatform.org/u/IlyaDiallo)\
**Post date:** [January 22, 2021, 1:35pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/3 "2021-01-22T13:35:49Z")

</div>

Actually you can do it without restarting the server (we’re doing it). If the server is notified of the change, it can define the function(s) again. Only problem is that Parse logs a warning for the replacement of the previous function if it was already defined. That’s a minor issue, but I think that the Parse code should acknowledge this use case, restarting the server outside maintenance schedules can cause issues.

---

<div class="post-metadata">

**Author:** ![uzaysan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/uzaysan/32/59_2.png) [@uzaysan](https://community.parseplatform.org/u/uzaysan)\
**Post date:** [January 22, 2021, 3:05pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/4 "2021-01-22T15:05:08Z")

</div>

> [@IlyaDiallo](#):
>
> Actually you can do it without restarting the server (we’re doing it)

How? Can you show me?

---

<div class="post-metadata">

**Author:** ![IlyaDiallo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/ilyadiallo/32/106_2.png) [@IlyaDiallo](https://community.parseplatform.org/u/IlyaDiallo)\
**Post date:** [January 22, 2021, 3:25pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/5 "2021-01-22T15:25:39Z")

</div>

> How? Can you show me?

By calling `Parse.Cloud.define` with the new code

---

<div class="post-metadata">

**Author:** ![uzaysan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/uzaysan/32/59_2.png) [@uzaysan](https://community.parseplatform.org/u/uzaysan)\
**Post date:** [January 22, 2021, 3:26pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/6 "2021-01-22T15:26:32Z")

</div>

I know that. I’m asking how to update code without restarting parse server

---

<div class="post-metadata">

**Author:** ![IlyaDiallo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/ilyadiallo/32/106_2.png) [@IlyaDiallo](https://community.parseplatform.org/u/IlyaDiallo)\
**Post date:** [January 22, 2021, 4:11pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/7 "2021-01-22T16:11:23Z")

</div>

We send a notification to the server when the code has changed, alternatively the server can process the change in an afterSave trigger because the cloud code is stored in the database. Then the server loads the new code from the database as text, converts it to executable code and calls `Parse.Cloud.define` with the new code as parameter.

---

<div class="post-metadata">

**Author:** ![dblythy](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dblythy/32/231_2.png) [@dblythy](https://community.parseplatform.org/u/dblythy)\
**Post date:** [January 31, 2021, 3:04pm UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/8 "2021-01-31T15:04:51Z")

</div>

I’m still working on [this PR](https://github.com/parse-community/parse-server/pull/6983) that will hopefully allow for dashboard cloud code editing with auto-restart 😊

---

<div class="post-metadata">

**Author:** ![dblythy](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dblythy/32/231_2.png) [@dblythy](https://community.parseplatform.org/u/dblythy)\
**Post date:** [February 10, 2021, 3:14am UTC](https://community.parseplatform.org/t/deploying-cloud-code/1227/9 "2021-02-10T03:14:35Z")

</div>

Just FYI: this is more of a feature for the example repo rather than the core server.

[This](https://github.com/parse-community/parse-server-example/pull/386) PR will add `npm run watch` to your local Parse Server, and will rebuild the server on Cloud Code change.
