How to connect to an external database running on localhost

Hello,

I have installed discourse on macbook for development using the “beginners-guide-to-install-discourse-for-development-using-docker” instruction.

Now, I have a separate postgreSQL database with users table that contains all the users’ information for my other web app.

My question is, is it possible to login to discourse using that separate users table that is running locally on my macbook?

I tried the Official Single-Sign-On for Discourse (sso) method but I wasn’t able to get this to work because it seems like this method is for production and also tried Running Discourse with a separate PostgreSQL server method but no luck there either.

I have attached a very basic diagram of what I would like to do for a better understanding.

discourse

If you need any further information, please let me know.

Thank you!

You can get SSO to work in a local development environment, but it might be difficult to configure it to work with the Docker development environment. You could try installing Discourse without Docker on your Mac by following this guide: Beginners Guide to Install Discourse on macOS for Development. With that setup, your Discourse site will be on http://localhost:3000. You’ll be able to make SSO requests directly to it without having to deal with networking issues.

3 Likes

This worked for me. Thank you!