How to create your own private messages service with macOS Server!

How to set up iMessage on your Mac
How to set up iMessage on your Mac (Image credit: Joseph Keller / iMore)

Instant messaging is a must in today's business sharing and collaboration software toolset. There are instant messaging services that are free to use (but may need access to your data) or there are paid services that can charge per user.

If you're in need of an instant messaging service that avoids giving up your private information and only costs a nominal fee regardless of the number of users you need, then the messages service on macOS server may fit your bill.

We'll be showing you how to setup and create a private messaging service on macOS for your locally networked connected Macs, iOS devices, and PCs connected to your macOS Server VPN service. Although we can set up this service to allow access from anywhere on the internet without a VPN, we feel the purpose of offering a highly secure and private messaging service outweighs the convenience of being easily accessible.

Install macOS Server on one of your Macs

If you haven't already done so, you'll need to install macOS Server on one of your network Macs. You can follow our detailed guide if you need a little more help, but here is the express version.

  1. Launch the App Store application.
  2. Search for macOS Server in the search bar at the top right of the app.
  3. Click Buy next to macOS Server or if already purchased, you'll be notified that you can download it for free.
  4. Click Install.
  5. Agree to the User Agreement.

Add users to your macOS Server

In order for your organization to start collaborating, you'll need to add the users whom you want to have access to the service.

  1. Start the Server App.
  2. Select Users from under the Accounts listing.
  3. Click the Add button (it looks like a plus symbol) to add a new user.
  4. Type in the Full Name of the user you want added.
  5. Enter a Password for the user.
  6. Verify the password for the user.
  7. Click Create.

  1. Repeat for as many users as required.

Configure the messages service

We'll now need to configure the messages service to only accept connections from your local network IP addresses.

  1. Select Messages from the services listings in the Server App.
  2. Click Edit Permissions.
  3. Select private networks from the dropdown list under When connecting from.
  4. Click OK.

  1. Optionally check Archive all messages if you wish to save all of your organization's messages from every user to disk.Note: If you wish to secure this data, make certain to select an encrypted location to save this file to.
  2. Toggle the ON/OFF switch to ON.

If you have an Airport Base Station, you will be prompted to allow for macOS Server to automatically open ports through your router so that external clients can connect to your messages server. Do not allow this. Although it's possible to set this up as a regular internet service to connect from anywhere, the purpose of this tutorial to keep it as secure and private as possible and that sort of setup is beyond the scope of this article.

Connect your Mac clients

For macOS, Apple has already built in functionality for the xmpp protocol, the software that underlies the messaging system used by macOS Server. This means that you needn't download any third party messaging clients and you can work seamlessly with the messages app.

  1. Start your Messages app.
  2. Click Messages in the App menu in the upper left corner of the screen.
  3. Select Add Account from the drop-down menu.
  4. Select Other Messages Account.
  5. Click Continue.

  1. Select Jabber from the Account Type dropdown list.
  2. Enter the User Name you created on your macOS Server in the form of UserName@mac-mini-host-name.local.Note: It's very important to use the Host Name associated with your macOS Server otherwise you'll need to edit configuration files located in /Library/Server/Messages/Config/jabberd.
  3. Enter the Password associated with the user name you entered.
  4. Click Sign In.
  5. Click Continue when prompted to accept the server certificate.

  1. Set your Jabber status to available to log in.
  2. Select a user on the same Local Account as the private server you connect to to start messaging.

Connect your iOS device

You can do a search for xmpp from the app store to see a list of xmpp clients available to download but we found that Monal is about as easy to set up as can be and works well with our macOS Server. Monal also runs on Android and has a native macOS client as well.

  1. Open the App Store on your iOS device.
  2. Search for Monal.
  3. Tap Download.
  4. Tap Install.
  5. Tap Open.
  6. Skip the Tutorial.
  7. Add a New Account.
  8. Under Jabber ID enter your UserName@macOS-server-host-name.local.Note: Make certain to enter a User you created on the messages server and also make certain you use the host name you used when setting up your macOS Server.
  9. Set Self-Signed Certificate to on.

Connect your PCs

We won't go too deeply as to how to connect your Windows and linux PC's but xmpp.org has a nice list of different clients you can try to connect to your macOS messages server.

Connecting when on the local VPN

For you remote users, you can still take part in the private messaging service through the VPN (virtual private network) if you have one set up. You'll need to add your macOS Server's internal network IP address to your personal computer's Host file. Here's how you do it on macOS.

  1. In finder or terminal navigate to /etc.
  2. Edit hosts using your favourite text editor using an administrative account.
  3. Append the IP Address and Host Name of your macOS Server. This will be in the form of "xxx.xxx.xxx.xxx Hostname.local". For example, mine looks like "192.168.15.154 anthonys-mac-mini.local".

  1. Connect to the VPN on your network.
  2. Set up your macOS computer to connect to messages as instructed above.

How do you keep your messages secure?

Now it's your turn! Let us know how you manage to keep your messages safe and secure or if you simply think this is much ado about nothing!

Anthony Casella