Documentation

Connect to the Database With TablePlus

Connecting to your project's database with TablePlus is super easy, and a great way to get a clear idea about Craft's database content and structure.

Note: If you're looking to import data, we'd recommend taking a look at the Import Database documentation.

1. Start an SSH Tunnel #

  1. Go to your project's Access Control page.

  2. Create a new SSH Session. You can read more about SSH Sessions here.

  3. In the "SSH Connection" section, select an environment and check the "Include database port forward" option.

  4. Copy the supplied SSH Connection string into a terminal on your local machine.

    Run it to open an SSH connection with an included port forward for the database.

2. Connect to the Database #

  1. Copy the "Full URL" from the "Database Connection" section in the Access Control page.

  2. Open up TablePlus.

  3. Click the "+" button.

  4. Click the "Import from URL" button. A dialog window should open up with the Full URL that you copied from the Access Control page.

  5. Click the "Import" button. This should open a connection dialog window.

  6. Give the connection a good name. If you prefer, you can select a tag and color that corresponds to the environment you're connecting to - we like red for production. 🚨

  7. Click the "Test" button to double check the connection is successful. If it is, then the fields should all change green.

  8. Click "Connect" if you just want to connect to the database without saving the credentials. Otherwise, click the "Save" button and then double click the connection you just created from the list.

  9. You're now connected to your database. ✅ Watch what you delete now!