Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access ionic serve -address

The ionic CLI gives the option to serve the app via

ionic serve -address=my.backend.server.com

How can I access the address given through this command in the project?

like image 647
ratatosk Avatar asked Jan 21 '26 12:01

ratatosk


2 Answers

If you need to host dev server on all network interfaces (i.e. --host=0.0.0.0), you can use

ionic serve --external

Then you will have the ability to access you application by navigating to any network interfaces IP (check ipconfig command)

http://192.168.1.68:8100/
...

If you need to host on custom address, please note that CUSTOM_ADDRESS_IP should be an available IP which is assigned to your actual device

ionic serve --address CUSTOM_ADDRESS_IP

Reference
https://ionicframework.com/docs/cli/commands/serve#option-external

like image 90
ahmednabil88 Avatar answered Jan 24 '26 11:01

ahmednabil88


If you want to serve the application on your server and not on your local machine and reach the application through the public internet you could do the following:

ionic serve -address=0.0.0.0:8080

Then you should be able to reach the application on:

youripaddress:8080

if the dns zone entry file of your domain points to your server's ip adress you should also be able to reach your application through your domain:

yourdomain.com:8080

Also make sure that the firewall on your server accepts traffic to the port that the application is running on (in this example 8080)

like image 32
matyas Avatar answered Jan 24 '26 12:01

matyas