How to set up pgadmin4 with nginx in ubuntu 16.04?

6,158

You've really only got a handful of options here.

(1) Use nginx and a backend that runs the pgAdmin4.py Python file. Whether this is Unicorn, or uwsgi launched, and you proxy_pass or similar to the backend in nginx is up to you, however this is one option.

(2) Launch pgAdmin4.py (doesn't matter if it's SERVER_MODE = True or SERVER_MODE = False), run it on the standard localhost:5050 port, and then set up nginx to proxy_pass all requests to the configured domain/hostname to pass off to the backend, with:

location / {
    proxy_pass http://localhost:5050;
}

... or similar.

Beyond that there's not really much you can do otherwise to get pgAdmin4.py to work with nginx. (I use the second of these options on my laptop, with a customized configuration and pgAdmin4 launched as a dedicated system user)

Share:
6,158

Related videos on Youtube

Thomas Ward
Author by

Thomas Ward

Updated on September 18, 2022

Comments

  • Thomas Ward
    Thomas Ward almost 2 years

    I installed pgadmin4 in my ubuntu server with SERVER_MODE = True.

    I have nginx as the web server handling all the request. How do I set up nginx to serve pgadmin4?

    Also How do I create pgadmin4 to start automatically when the server start?

    • Shivam Kotwalia
      Shivam Kotwalia almost 7 years
      Any heads up on this bro ?
    • Admin
      Admin almost 7 years
      thanks for the help. I use nginx + gunicron. will give it a try.