This ensures that it’ll have full access. If you want it to start automatically then do this as well: Now you can move that over to /etc/systemd/system/
#ROCKETCHAT SNAP PORT UPDATE#
If you’re doing more than two, you can keep doing this process, just make sure you update the first mongodb line, root url, the port, and the avatar path. snap/rocketchat-server/current/bin/node /snap/rocketchat-server/current/main.js Head to your home directory and make a new bash script to start the thing up:Įxport MONGO_URL=mongodb://localhost:27017/parties2Įxport MONGO_OPLOG_URL=mongodb://localhost:27017/localĮxport Accounts_AvatarStorePath=/var/snap/rocketchat-server/common/uploads2 Ok, so you have your data ready for a new instance. I swear, I thought it locked up or I forgot a semi-colon. This will take a second, wait for the prompt to come back. Log into MongoDB and copy parties database to another new databaseĭb.copyDatabase("parties", "parties2", “127.0.0.1") Here are the step-by-step instructions to accomplish this if you feel the need:
The service uses a mongo database to store everything so I needed to copy that as well.
#ROCKETCHAT SNAP PORT HOW TO#
When I returned to the actual problem it occurred to me that I only needed to find out how to activate the service normally from a non-snap environment and then explicitly reference each of those elements from within the snap. So I did what any self-respecting admin did: I read 2 pages of the manual, got frustrated with it, tossed it out, googled "multiple snap instances", got nothing useful, and then had a drink. What's worse is the database and everything else is contained within the walled garden of the snap. There is no easy way to get the snap service to fork into multiple running instances. But for now our suggestion would be to use a reverse proxy like nginx in front of the snap. In the near future we will be adding support for this, as well as to add ssl. The issue comes when you need to run multiple rocket chat services for different domains as they did. Currently the Rocket.Chat snap doesn't have the option to change the port its listening on.
#ROCKETCHAT SNAP PORT INSTALL#
It's a nice setup, you install the snap management service and then install rocket chat from that, it automatically self-updates periodically and you're pretty much hands-free. This amounts to basically a docker component, or for the uninitiated a self-contained application. The default method for running the service from 16.04+ is to use a Snap. so, first thing is to get a swapfile up and running.When setting up Rocket Chat for a site running Ubuntu I ran across an interesting problem.
we will close this port later.Įc2 micros only come with one gig of ram out of the box and no swap partition, which is fine for hello-world calibre stuff, but rocketchat wants ram. We will also want to have a domain name pointing to our ec2, so fire up route53 and do that, and port 3000 open on our firewall. this is slim at the best of times, but rocket and mongo eat up disk space, so we're going to give ourselves a 20gb disk. The default disk size for t2.micros is 8gb. if you plan on this being used in production, an elastic ip is highly recommended. for the detail-oriented, that's ami-03d5c68bab01f3496.Įnsure that you have a public ip address. This is going to be on an ec2 t2.micro running ubuntu 20.04. In this fly-over we will be deploying rocket chat backed by mongodb 5.0 on an ec2 t2.micro running ubuntu 20.04 and we'll be putting it behind an nginx reverse proxy so we can serve easily over ssl. if you're looking to include live chat in your next project or are just looking for a roll-your-own slack replacement, it's a good candidate. Rocketchat is a slick chat server that you can deploy yourself.