i need help using pm2
Unanswered
Whiteleg shrimp posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Whiteleg shrimpOP
so i'm trying to use pm2 on my next js project, managed to use it bu running pm2 start ./node_modules/next/dist/bin/next --name "appName"
but i want to set port
but i want to set port
8 Replies
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
idk about pm2 but if you want to set the port name i think you can set the PORT env var or use
--port
./node_modules/next/dist/bin/next --name "appName" --port 8080
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
European sprat
yeah i explained this the other day but they never mentioned if it worked or not
if --port 8080 doesn't work, try what i had originally said
PORT=8080 pm2 start ./node_modules/next/dist/bin/next --name "appName"
PORT=8080 pm2 start ./node_modules/next/dist/bin/next --name "appName"
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Whiteleg shrimpOP
they both do not work
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
European sprat
I guess you're out of luck then
Another solution could be directly modifying the server files where the port is defined but that's out of scope and unsupported
The alternative is use a standalone build which uses nodejs to run the server and you can easily set the port