How to install SQL Workbench for postgreSQL

Last updated on March 24, 2020

In my previous SQL for data analysis tutorial, I briefly mentioned that I prefer SQL Workbench over pgadmin4 for SQL querying. Today I will show you how you can install it too! The setup process is more or less the same on Mac, Windows and Linux, but I’ll highlight the slight differences in my article – and you can always select the appropriate solutions for yourself.

STEP 1: Download and install Java 8+ on your computer!

SQL Workbench works with Java8+, so until you have this package, you won’t be able to run it! Java will be useful anyway, so simply download and install it from here:

It is fully free – provided by Oracle.

STEP 2: Download SQL Workbench!

It’s free too and you can get it here:

Here, you’ll see all the previously released SQL Workbench versions.

When I write this article, Build 124 is on the top. Whether it’s on the top for you as well or not, please go and find this exact version: Build 124.

And make sure you are downloading the right version for your operating system:

sql workbench install

STEP 3: Open SQL Workbench!

Once you have downloaded your file, unzip it! You don’t have to install anything, just run the SQL Workbench application. If you have trouble opening it:

  • On Windows: right click on SQLWorkbench.exe –» Run as administrator
  • On Mac: right click on SQLWorkbenchJ –» Open

STEP 4: Download the postgreSQL plugin!

Unfortunately you have to download a postgreSQL plugin too!

Read the instructions and download the appropriate version (in our case, this is going to be the one that is compatible with Java8+). When I’m writing this article (May, 2017), the right file is: PostgreSQL JDBC 4.2 Driver, 42.1.1


Important! Put this file in a folder where it is safe and where you won’t accidentally move or remove it.

STEP 5: Connect to your server!

Note: if you don’t have your own data server to practice yet, set one up here: Install Python, R, SQL and bash!

When you run your SQL Workbench application, the first window will be the “Connect window.” If not, you can still access it from File –» Connect Window.

It requires a few pieces of information to make the connection:

Name: You have to name your connection, which can be anything. (I’ve typed in: “My first postgreSQL connection”)

Driver: Select PostgreSQL! You will get an error message. Something like this:

SQL Workbench error: "The library for the driver is not accessible!"

SQL Workbench error: “The library for the driver is not accessible!”

Click YES!
As you can see, SQL Workbench can’t find the postgreSQL driver by itself… Let’s help it out and click the little Folder icon.


Go and find the driver that you just downloaded during STEP 4. Open it!

SQL workbench postgresql-42.1.1.jar driver defined

postgresql-42.1.1.jar is imported…

If you can see it on the “Library list” (shown in the above picture), click OK and your driver will be set!

URL: The URL has 4 parts.

sql workbench url

  1. The jdbc:postgresql:// is a constant in our case. You don’t have to change it.
  2. The next part (red) will be the IP address of your server. Type your server’s IP address (the format should be something like:
  3. The next step (green) is the port number. If you followed my tutorials so far, this is going to be 5432 for you as well!
  4. Finally provide the name of the database that you want to access (it can be anything that has been created before… If you followed my tutorials so far, it will be postgres!)

Note: usually when you get access to a database, you get this information (IP address, port, database name) from the admin of the database.

Username: This should be the username that you set up when you installed your data server. (e.g. for me it’s “dataguy” or “tomi”)

Password: Your previously set password.

If you did everything properly, you should have something like this on your screen:

SQL workbench ready to login

Click OK and the connection will be established!
Congrats! You are in!

Note: It’s worth saving your connection details so you don’t have to type them again!

STEP 6: Run a test query!

As a last step, just run some sample queries to test out your new SQL query tool!
You can try the classy SELECT * FROM zoo; or you can go ahead and explore your data tables via the Database Explorer feature:

SQL explore

SQL database explorer


Aaand… That’s it for today! You have a cool free SQL query tool, SQL Workbench. From now on you can use either this or pgadmin4 to complete my SQL for data analysis tutorials!

SQL for Aspiring Data Scientists (7-day online course)

I’ve created an online course that will take you from zero to intermediate level with SQL in 7 days. Go ahead and check it out here:

sql for aspiring data scientists online course header 2

More info…

Tomi Mester

← Previous post

Next post →


  1. Hey this is a great article, however, after using the SQL Workbench interface, it is not very user friendly. Is there a reason to not use pgAdmin? Seems much easier to use, and no need to download extra plugins to get it to work.

    • hi Nitin,

      thanks and fair point. Some might prefer pgAdmin, I prefer SQL Workbench, but feel free to use any of the SQL tools you like! 🙂


  2. can i use this way for Visual Database Design of the Workbench?

    • hi Dimitar,
      Unfortunately, I can only give the same answer that I gave to Jason:
      “I’m not sure, to be honest – as far as I know, it’s not possible… at least, I’ve never done it so far!”

  3. Hi, Tomi
    Thanks for great information.
    does this workbench have an option to design and generate ER diagram as mysql workbench does?

    • hi Jason,
      I’m not sure, to be honest – as far as I know, it’s not possible… at least, I’ve never done it so far!
      However, if anyone who knows a good solution is welcome to share in comment! 😉

  4. Hi
    I am new to this world and according to your other article I have already installed pgadmin4.Do I need to install sqlworkbench again?.I am confused 😞

  5. Hi Tomi,
    Thanks for sharing this useful information.

    I tried to configure a connection to Tableau PostgreSQL.
    Even if I have followed all your guidelines, I still have this error message when I connect:
    FATAL: no PG_HBA.conf entry for host “”, user “readonly”, database “workgroup”, SSL off.

    when I googled it on the tableau community , I found this

    Our server is SSL Enabled, and we want to keep this enabled.
    I struggle to find how to configure SSL access in SQLworkbench.
    Would have any info or recommended webpage ?

    Thanks in advance


    • hey Patrick,

      thanks for the question. I’m not sure if it’s related to SQLWorkbench at all.
      I haven’t met with a similar issue before and I don’t really have the answer… although I’d try to give super-user privileges to your user first. Login to SQL and type ALTER USER [username] WITH SUPERUSER;

      Let me know if it worked!

    • In case anyone else is looking for the solution…

      In the SQL Workbench Connection Profile Window:
      – Select the profile you want to configure SSL
      – Click the “Extended Properties” button
      – Add two Properties (click the blank sheet icon in the form header):
      — sslrootcert and sslmode
      — The Value for the sslrootcert property should be a full path to the .pem file
      — The Value for the sslmode property should be: verify-full

      Other values for sslmode can be found here:

  6. Eni Patrick

    Hey Tomi,

    I can’t tell you enough how helpful your tutorials have been! Thanks!

    Step 5 above: when trying to connect using the server access I obtained through digital ocean (I followed your tutorials very closely!), I keep getting the same error message, both via pg4admin and via SQL workbench on my computer:

    “Connection to refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.”

    I have no trouble connecting on my mac terminal via ssh username@ip_address. I also have no trouble on pg4admin or SQL workbench when I do localhost:5432.

    However, I was really hoping to have one integrated gui (server option, if possible) so that I don’t have to recreate my tables for each interface.

    Do you have any suggestions for how I might fix this problem and connect via the server?


  7. Eni Patrick

    I found the solution to my question. Basically, I followed a variation of this:

    I just had to remember to do the steps as a root user and restart after each change I made.

  8. wow Great Tomi i went through this first page will start reading all pages i think this is the best info to learn sql for data analysis.

  9. Tamás Tarczy

    Hi Tomi,

    I am on Mac and PC. I installed the pgAdmin4 but I can’t connect to the server:
    Unable to connect to server:
    FATAL: password authentication failed for user “xxxx”

    Using the command line I can reach the server and I see the database. I use the same password and username in the pgAdmin without success.
    I made all the setup that is written in the article.

    What can be the problem?

    Thank you

Leave a Reply