# How to package ionic to run on Linux

**URL:** <https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052>\
**Category:** Ionic Native\
**Created:** [May 8, 2018, 11:34pm UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052 "2018-05-08T23:34:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmamila](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rmamila](https://forum.ionicframework.com/u/rmamila)\
**Post date:** [May 8, 2018, 11:34pm UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052/1 "2018-05-08T23:34:34Z")

</div>

I was asked to build a simple POC app for a doc signing solution to prove some unknowns. We had a possible requirement that this may need to run on some mobile devices in future but it’s not an immediate requirement.  
I did a simple UI with ionic and built the back end API with Spring-boot. I need to be able to hit from different browser types (Chrome, FireFox and IE) to prove one of my unknowns to establish the browser cache behaviour. My local dev env is MacOS. Now I need to deploy this into a Linux machine and hit from IE.

Then I realise I can’t package this for Linux. I don’t need to deploy to any mobile OS’s now. I am using the free version. I tried with below command and does not work.  
**ionic package build linux --profile=prod --release --prod**

I couldn’t find a way to get around this. Not sure if this is because I am using the free version. Do I have to rewrite my simple javascript UI without using ionic to continue with my POC??

---

<div class="post-metadata">

**Author:** ![Tommertom](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Tommertom](https://forum.ionicframework.com/u/Tommertom)\
**Post date:** [May 9, 2018, 12:09am UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052/2 "2018-05-09T00:09:05Z")

</div>

> **[Ionic Framework](https://ionicframework.com/docs/cli/commands.html)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

Ionic package is deprecated

Targets for a build are ios, android or www (and maybe even wp?)

If u want to use a browser on a linux box then u neef to build for www, place the files generated under www/ folder on the box, run a webserver and surf to it

```auto
ionic build --prod

```

U can only build for www and android on a linux box. If u want to build for ios on linux then basically u need to have this package built in the cloud platform ionic provides (and pay apple for dev license)

---

<div class="post-metadata">

**Author:** ![rmamila](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rmamila](https://forum.ionicframework.com/u/rmamila)\
**Post date:** [May 9, 2018, 1:17am UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052/3 "2018-05-09T01:17:35Z")

</div>

Thanks for the reply @Tommertom

I am only deploying on Linux but developing on a Mac. I use the browsers on a different Windows machine to hit the application running on Linux.

If I only deploy the content in www folder into Linux, and ran “ionic serve” it complained that it can’t find tsconfig.json which is not copied into www folder. Therefore I copied the entire content in the next level folders which managed to start with “ionic serve”.

But I don’t think I am doing it right. There must be a way to just package everything required in the www folder.

---

<div class="post-metadata">

**Author:** ![robinyo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/robinyo/32/115964_2.png) [@robinyo](https://forum.ionicframework.com/u/robinyo)\
**Post date:** [May 9, 2018, 2:24am UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052/4 "2018-05-09T02:24:00Z")

</div>

After you do a `prod` build of your PWA you just need to serve the contents of the `/www` directory.

For example:

```auto
npm run build --prod
npm install http-server -g
http-server ./www

```

Then navigate to:

```auto
http://localhost:8100

```

**Don’t use “ionic serve” in a Production environment!**

Use Nginx (for example) to serve you static assets or Google Hosting’s free tier:

```auto
npm run build --prod
firebase deploy

```

See: [https://robferguson.org/blog/2017/08/12/migrating-from-ghost-0-x-to-ghost-1-x/](https://robferguson.org/blog/2017/08/12/migrating-from-ghost-0-x-to-ghost-1-x/)

---

<div class="post-metadata">

**Author:** ![Tommertom](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Tommertom](https://forum.ionicframework.com/u/Tommertom)\
**Post date:** [May 9, 2018, 4:33am UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052/5 "2018-05-09T04:33:06Z")

</div>

@robinyo is providing the missing link (even if your app is not a PWA)

```auto
Ionic serve

```

Is not intended for serving prod, only dev workflows

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:36pm UTC](https://forum.ionicframework.com/t/how-to-package-ionic-to-run-on-linux/130052/6 "2021-07-19T21:36:54Z")

</div>


