> ## Content Index
> Fetch the complete content index at: https://til.codes/llms.txt
> Use this file to discover other available public pages before exploring further.

# Start Phoenix app with cowboy server on different port
- URL: https://til.codes/start-phoenix-app-with-cowboy-server-on-different-port/
- Published: 2015-11-23T04:12:47.000Z
- Updated: 2015-11-23T04:12:47.000Z
- Author: Manu Ajith
- Tags: phoenix, elixir, cowboy, #Import 2024-07-13 21:01

To run phoenix app on a custom port other than port 4000, tweak your config file for respective environment(dev/prod/test) to the following:

```
config :my_app, MyApp.Endpoint,
  http: [port: {:system, "PORT"}],

```

Then from the terminal:

```
$ PORT=4001 mix phoenix.server
$ PORT=4002 mix phoenix.server

```

Enjoy.!