I have an angular-2 project running on my local host. I want to deploy it to GoDaddy server. I can't install node, npm on GoDaddy server. So my question is how can I run my angular-2 project on GoDaddy server. Thanks
-
1use universal webpack to bundle your project into one js file with index,html. you can upload that as normal html and js file. if backend is in node.js go for digital ocean or heroku. – Amit kumar Jan 28 '17 at 07:27
5 Answers
Install Angular CLI if you don't have it already.
npm install -g angular-cli
Then build using the command -
ng build
This will create a /dist directory with the production build of your application. Just copy the contents of /dist to your hosting provider (using FTP, SCP etc.).

- 562
- 3
- 10
-
I have /dist files with me and I uploaded it in public_html folder but I don't see my app ruuning. I ran the command ng build --prod --env=prod. – National News Jan 28 '17 at 07:24
-
index.html is opening showing Loading but the components are not getting loaded actually – National News Jan 28 '17 at 07:30
-
You can try to check if there are any errors during page load. In chrome developer tools. Especially check for 404 errors in the network tab. – manojtc Jan 28 '17 at 08:40
-
1
-
-
Once you upload the files, you must edit index.html and remove
in order for the application to not get 404 errors – Sean Gildea Sep 18 '18 at 00:56 -
1.If your project is completed then build your project using
ng build --prod
2.Go to your project/dist Copy your Build Project which is automatically created and paste it to desktop -> Right Click on that pasted project folder -> Add to zip .
3.Go to your godaddy account -> profile -> my Products ->Starter Linux Hosting with cPanel ->manage ->cpanel Admin -> file manager .
Click on public_html folder .
click on Upload -> select file -> select your Zip folder -> click on link "Go Back to "home/frurugf45/public_html" .
And your Angular file uploaded on go godaddy server

- 111
- 1
- 4
-
What are the steps after this? I have done the above mentioned steps. Now, how can I launch the website? – Shubham Arya Jun 19 '20 at 13:36
-
after that decompress that and save everything. then go to browser and put your url there. – Anand raj Nov 04 '20 at 11:36
-
Run ng build --prod
don't forget to use --prod
. It means build the application in Production mode. It's performance of application is faster than ng build.

- 1,266
- 1
- 19
- 34

- 692
- 8
- 13
-
1This is the real answer; the accepted answer is not _incorrect_, simply _incomplete_. – pythlang Jul 05 '19 at 15:10
Use $ ng build --prod
if your application is ready for production. It will reduce the size and increase speed of your application on the web.
$ ng build
VS. $ ng build --prod
My small application went from 23mb to 2mb.
Loading time on 3G network: 8 seconds FAIR, 28% visitor loss due to loading time
VS.
Loading time on 3G network: 4 seconds GOOD, 10% visitor loss due to loading time

- 117
- 1
- 8
manojtc is corect...run npm build then copy all the files/folders from the dist directory to your website (or sub-domain) root folder...works like a charm..have it working in a GoDaddy Windows sub-domain

- 87
- 1
- 7