Hugo server port 1313 change to 8080 docker image

In my project AWS setup I have to use port 8080. With this docker command it works → docker run --rm -it -p 8080:8080 my_image_foo_bar:1.0.0 , but I don’t have a possibility to do that in the cloud environment. Where I can modify hugo server port to use 8080


Why do you want to run Hugo server on AWS? Are you developing on AWS?

Either way, you can configure the server port in the Hugo server config: hugo server | Hugo

Hi, I have to run my image in AWS Fargate. Please see my docker file there is already server -p 8080 command.

Please explain what you are trying to achieve. In development you can set Hugo server to any port you like, as you have done in your example, so what is the problem?

hi, ok. I want to build a docker image. When I run it by command docker run --rm -it my_hugo_image:1.0.11 I can go to my browser localhost:8080/and see my website. This works fine with the command docker run --rm -it -p 8080:8080 my_hugo_image:1.0.0, but I cannot run flag -p 8080:8080 in the AWS environment. Many Thanks…

I still don’t understand why you would want to run it on AWS. Hugo is a static site generator. You don’t need any compute resources in production, just a plain simple web server, a simple CDN (like s3) would be fine to serve a Hugo site.

Hugo server is for use in development. When you’re done developing run hugo build and get a ready-to-deploy website, which you can drop onto any basic web server.

aah. ok. this explain much. I have to figure out this s3 option with our admins… Thank you for your time. BR.Ana