# Edgemicro + PM2: Starting edgemicro as a service

**URL:** <https://discuss.google.dev/t/edgemicro-pm2-starting-edgemicro-as-a-service/17874>\
**Category:** Knowledge Hub\
**Tags:** apigee\
**Created:** [January 20, 2017, 3:29pm UTC](https://discuss.google.dev/t/edgemicro-pm2-starting-edgemicro-as-a-service/17874 "2017-01-20T15:29:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirene](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/mirene/32/72868_2.png) [@mirene](https://discuss.google.dev/u/mirene)\
**Post date:** [January 20, 2017, 3:29pm UTC](https://discuss.google.dev/t/edgemicro-pm2-starting-edgemicro-as-a-service/17874/1 "2017-01-20T15:29:30Z")

</div>

[PM2](https://github.com/Unitech/pm2) is a production process manager for node applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.

As we will see belowm Edge Microgateway, been a node app can benefit greatly from using this tool,

Find below the steps required to use PM2 with edgemicro:

1. Start edgemicro using the following command:

2. Check that edgemicro started properly having a look at the logs:

3. You can also have more details of the process running (pid, uptime, cpu usage, memory usage,…) with this other command:

4. Get the automatically-configured startup script for your machine you need to typing this command:

5. Once the scripts are generated run the following command to keep a list of the processes runing, so they will be started at boot time.

6. If you want to actively monitor how edgemicro is performing you just nee to run:

7. In case you would like to have a [Keymetrics](https://keymetrics.io/) dashboard, you can just go ahead and sign in for an account there, create a bucket and run the following command with the provided keys:

Give it a try and let me know how it goes.

---

<div class="post-metadata">

**Author:** ![davissean](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@davissean](https://discuss.google.dev/u/davissean)\
**Post date:** [January 20, 2017, 6:42pm UTC](https://discuss.google.dev/t/edgemicro-pm2-starting-edgemicro-as-a-service/17874/2 "2017-01-20T18:42:55Z")

</div>

Very nice write up, thanks Miren.

It is also worth noting that Edge Cloud developers that want to debug NodeJS proxies locally can also use PM2 and follow similar steps… although nodemon may be simpler for this purpose.
