Deploying a Phoenix backend with a separate frontend

Hi all,

I’m wondering if anyone would be able to recommend some options for deploying a Phoenix backend with a separate frontend. If I have a Phoenix-only app, then I could use something like Gigalixir. If, on the other hand, I have a standalone frontend, I don’t think that I can do that anymore.

If anyone has any experience with this, then please let me know.


Definitely we can have an API in Phoenix and separate frontend application that talks to that api.

There are even flags for Phoenix generator to omit frontend related parts:
mix app_name --no-html --no-webpack
(see more mix — Phoenix v1.5.8)

BTW, channels with WebSocket should also be available if required =)

1 Like

You still can. You can put them together and let phoenix to serve the static files.

Or if you prefer a separate, standalone frontend app, there are even more choices to host it, many of them are free. However, now you have 2 domain names (front end, api backend) your api backend need to have CORS setup.

1 Like

Thank you! :slight_smile:

Thanks, this is reassuring! :slight_smile: Would you say that having 2 domains names is a potential issue? I suppose that you don’t need a fancy one for the backend, you can just keep whatever the service you are deploying through will give you as opposed to buy a separate one, right?

Always use your own domain name. you can use a sub domain, like:

logistic issues aside, you may want to share cookie.

1 Like