About Checking if a Port is Open

When you want to check if some service like Memcached, Redis, PostgreSQL, MySQL, Gunicorn, Apache or Nginx can be accessed on specific port, you can check its openness with:

1
$ nc -vz <ip_or_domain> <port>

For example, this checks if PostgreSQL is running on the same server and on its default port:

1
$ nc -vz 127.0.0.1 5432

Tips and Tricks Dev Ops Databases Maintenance PostgreSQL MySQL Apache