Skip to content
Advertisement

How to run Ionic serve permanently?

I am using Ionic framework for one application. The code is on a linux server. I am running the application using ionic serve command through putty.

But, the problem is if I close the putty the application is stopped. Is there any way to run the ionic serve permanently as a daemon process?

Advertisement

Answer

I’m suspecting you’re trying to do this because you want to serve your Ionic app as a web app, correct?

In that case – you don’t have to run ionic serve permanently. All you have to do is take all the code from the www folder and place it in the http folder (or any other which is valid for your system) of your web server.

So, basically, spin up apache (or nginx) and serve the code from the Ionic’s www folder. Basically, ionic serve command does the same thing – it spins up a local web server and serves the content from the www folder. It does that for faster local testing.

You can take a look at this SO question for more info on how to deploy Ionic as a website.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement