Monday, 19 October 2015

Docker, and Openfire!


In the past couple of posts ive discussed how you can use docker to deploy Gogs (which we then used as a password manager with Pass), then I blogged about how you can use it to roll out OpenVPN very easily, and I wrapped up how we can use Docker to deploy Bind to block ad-servers. They were pretty short posts, and that in some ways lends itself to how easy Docker is to do deployments. I've said it a lot of times that Docker is like a cross between, Git, apt-get, and Vbox. I'm going to continue this run with a few other blogs this week about other day-to-day services that people may find useful.

So lets start this week off with XMPP, or more to the point Openfire. With Openfire, you can have your own private XMPP server for chat. Openfire is a pretty easy to use server which is even easier to deploy using Docker. Within a few commands you will be able to have your own chat server which can communicate with the rest of the world, but under your control.

As usual you'll need to make sure you have Docker installed. If you don't have it installed then please either visit https://docker.com or use a search engine to find guide for your OS.

We're going to use the great work of Sameersbn again (https://github.com/sameersbn/docker-openfire), and i'd also suggest either using a Dynamic-DNS service like these people https://nsupdate.info/ (they offer instructions on how to update your sub-domain to your IP address, you'll need it later when you configure Openfire) or buy yourself a domain name, they're pretty cheap after.

So we're going to pull the openfire image down from the the docker hub, however feel free to build the image yourself ('$ docker build -t' ).

So here we go

$ docker run --name openfire -d --restart=always \
  --publish 9090:9090 --publish 5222:5222 --publish 7777:7777 \
  --volume /srv/docker/openfire:/var/lib/openfire \
sameersbn/openfire
 
and there you have it, you've just installed and deployed Openfire in a single command. Now all you need to do is configure it. Go to http://127.0.0.1:9090 and follow the install instructions. You'll find a folder on your host system at /srv/docker/openfire with the configuration details if you ever need access to them. Remember you'll need to set up port forwarding on your firewall/router to be able to communicate with the outside world. If you're looking for a client for your Android phone my I suggest grabbing Conversation (https://f-droid.org/repository/browse/?fdid=eu.siacs.conversations) it's pretty nice. Also its worth mentioning Openfire has plugins, you could use those plugins to install Kraken which will give you a Facebook and GTalk transport as well. Which the tl;dr of that is, you can have Facebook IM's and GTalk i'm all rolled in to a single account.

Hope some of you find interest in this post

Finux Xx