There are various reasons why the self hosted version of your app might not be working as expected. Here are a few common problems faced and how to fix them.

Self hosting on Cloud services

If you cannot view the application on the public IP of your cloud, here are a few reasons why -

  • Make sure your inbound rules accept traffic from ports 80 and 443 to allow traffic for HTTP and HTTPS respectively.
  • Make sure to use the Public IPV4 address to open the application.

Setting up Google Authentication

To ensure that Google Sign in works properly on your application, you need to keep in mind these following steps -

  • Ensure that all the Google authentication credentials like AUTH_GOOGLE_CLIENT_ID, AUTH_GOOGLE_SECRET and AUTH_GOOGLE_CALLBACK_URL have been properly set up and configured in your .env file.
  • In your Google Cloud console, make sure to set up your Redirect URIs properly. This should match the AUTH_GOOGLE_CALLBACK_URL in your .env file.

Connecting to MongoDB instance

If the data in your application is not persisting, it could mean that your MongoDB connection has not been established properly. This could mean a few things -

  • Copy the connection string from MongoDB atlas into the MONGO_URL variable in your .env file. Make sure the connection string has the correct DB username and password.
  • Allow network access from your current IP address or the hosted IP address on Atlas.

User Authentication failing

If you are hosting your application on the cloud, then user authentication is going to fail on the http domain. Therefore, it is essential to set up https for your domain with SSL certificate.

  • If you are running the docker image directly with docker run, make sure to provision the SSL certificate and set up NGINX directly on your infrastructure.
  • If you want to set up https directly without any further configuration, it is best to run the Docker Compose file that we provide, which has Nginx and SSL set up. You can read more about how to do this here.
Did you find what you were looking for?
What went wrong?
Need more help?We have a thriving Discordcommunity that can help you with all things Canonic. →