Hi
@mj69,
Welcome to the MongoDB Community forums ![]()
If you start MongoDB as a service on Ubuntu, it will be running in the background and your web server will have access to the database until you shut it down manually - Reference
If you are open to using a managed service, I recommend that you consider using MongoDB Atlas before deploying a database manually, as an improperly configured database may pose security risks.
You need to configure security and access control - Please refer to the MongoDB Security Checklist. You should enable authentication, configure a Role-Based Access Control, and configure network encryption with TLS.
This depends on whether you wish to use Compass as a different user. In some cases, you might not want to run Compass as a super user on a regular basis. For this purpose, it would be necessary to create a user with limited permissions and use that user as part of the Compass connection string.
MongoDB Compass can connect to local or remote deployments.
To gain a deeper understanding of MongoDB, I would recommend you take these courses from MongoDB University.
I hope it helps!
Thanks,
Kushagra