Connecting Multiple Devices on the Same LAN to Use the Same Perfect Management System Account

2025-08-08

PM
Perfect Management Systems

Connect Multiple Devices on the Same LAN

Pharmacy • Patient • Ward • Inventory • Billing • Rota (and more)
CouchDB LAN Offline-first
Setup

Installing CouchDB on the Host Device

CouchDB must be installed on your chosen host device before connecting other devices on the LAN. Follow the steps below for your operating system.

For Windows Host
  1. Go to the official Apache CouchDB downloads page: https://couchdb.apache.org
  2. Download the Windows installer (.msi).
  3. Run the installer and follow the prompts.
  4. Choose Install as a Service so CouchDB runs automatically.
  5. After installation, open http://127.0.0.1:5984/_utils/ in your browser to verify.
Default port is 5984. Keep note of your admin username and password during setup.
For Mac Host
  1. Install Homebrew if you don’t have it:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Run:
    brew install couchdb
  3. During setup, choose to run CouchDB as a background service:
    brew services start couchdb
  4. Verify by visiting http://127.0.0.1:5984/_utils/ in your browser.
For Linux Host (Ubuntu/Debian)
  1. Update packages:
    sudo apt update && sudo apt upgrade -y
  2. Install CouchDB:
    sudo apt install couchdb -y
  3. During installation, choose Standalone mode and set admin credentials.
  4. Once installed, verify via:
    http://127.0.0.1:5984/_utils/
For CentOS/RHEL/Fedora, use yum or dnf package managers.
Installation Complete: Once CouchDB is installed and accessible locally, you can proceed to configure LAN access for your Perfect Management System.

Configuration & Connection

You’ll connect any number of devices (Windows, Mac, Linux, Android, iOS, POS terminals) to the same Perfect Management System account on your local network by pointing them to a single CouchDB “host” machine.

One Host
Runs CouchDB + your Perfect app
Many Clients
All devices connect via LAN
Real‑time Sync
Shared database (port 5984)
AT A GLANCE
 
Prerequisites
Router or switch, CouchDB installed on host, credentials ready.
 
You’ll Do
Find host IP → Allow LAN access → Open firewall → Point clients.
 
Outcome
All devices securely share the same Perfect Management System data.

Prerequisites

 
Router or Switch: All devices must connect to the same LAN (avoid Guest networks).
 
CouchDB Installed on Host: Host runs CouchDB + your Perfect app.
 
Credentials Ready: CouchDB admin username & password.
 
Port 5984 Open: You’ll allow inbound TCP 5984 on the host firewall.
Supported Perfect Apps
Perfect Pharmacy Manager Perfect Patient Management Perfect Ward Manager Perfect Inventory Manager Perfect Billing Perfect Rota
Any Perfect Management System that uses CouchDB can be connected using the same steps below.

Recommended Network Topology

Host (Server)
Windows / Linux / Mac (Ethernet preferred), running CouchDB + Perfect app.
Example IP: 192.168.0.3
Clients (Many)
Windows PCs, Macs, Linux PCs, Android tablets/phones, iPads, POS devices.
Requirement: Same SSID/VLAN & same subnet (e.g., 192.168.0.x).
Step 1

Choose Your Host Device

Windows Host
Recommended for most clinics/shops. Easy service control.
Linux Host
Stable, server‑grade. Great for 24/7 uptime.
Mac Host
Good for smaller setups; simple GUI environment.
Step 2

Connect All Devices to the Same Network

Use One Router / SSID
All devices should join the same Wi‑Fi name or the same Ethernet switch/VLAN.
Subnet Check: IPs should share the first three octets (e.g., 192.168.0.x).
How to See Your IP
Windows: ipconfig • Mac: ifconfig • Linux: ip a • Phones: Wi‑Fi details.
Step 3

Find the Host Device’s LAN IP Address

For Windows Host
1. Press Win + R, type cmd, press Enter.
2. Run ipconfig.
3. Under your active adapter, note IPv4 Address (e.g., 192.168.0.3).
For Mac Host
1. Open Terminal (Applications → Utilities).
2. Run ifconfig.
3. In en0/en1, note inet (e.g., 192.168.0.15).
For Linux Host
1. Open Terminal.
2. Run ip a.
3. Under the active interface, note inet (e.g., 192.168.0.10).
Step 4

Configure CouchDB to Accept LAN Connections

By default, CouchDB only listens to 127.0.0.1 (localhost). You must change this so it listens on all network interfaces. Edit the local.ini file and set bind_address to 0.0.0.0.

For Windows Host
1. Open:
C:\Program Files\Apache CouchDB\etc\local.ini or C:\CouchDB\etc\local.ini
2. In the [chttpd] section, change:
bind_address = 127.0.0.1bind_address = 0.0.0.0
3. Save and close.
For Mac Host
1. Open Terminal.
2. Run: sudo nano /opt/couchdb/etc/local.ini
3. In [chttpd], change bind_address = 127.0.0.1 to 0.0.0.0.
4. Save (CTRL+O) and exit (CTRL+X).
For Linux Host
1. Open Terminal.
2. Run: sudo nano /opt/couchdb/etc/local.ini
3. Update bind_address in [chttpd] to 0.0.0.0.
4. Save and exit.
Security Note: Ensure CouchDB has a strong admin password before exposing it to your network.
Step 5

Restart CouchDB

After changing bind_address, restart CouchDB to apply the changes.

Windows
net stop "Apache CouchDB"
net start "Apache CouchDB"
Mac/Linux
sudo systemctl restart couchdb
Step 6

Allow CouchDB Through the Firewall (Port 5984)

CouchDB uses TCP port 5984. This must be open for other devices to connect.

Windows
  1. Open Windows Defender Firewall.
  2. Go to Advanced settingsInbound RulesNew Rule.
  3. Select Port → TCP → 5984.
  4. Allow connection for all profiles.
  5. Name it CouchDB.
Mac
  1. Go to System SettingsSecurity & Privacy → Firewall.
  2. Open Firewall Options.
  3. Add Apache CouchDB and allow connections.
Linux (UFW)
sudo ufw allow 5984/tcp
sudo ufw reload
Step 7

Test CouchDB Access from Another Device

From any client device on the same network, open a browser and enter:

http://:5984/_utils/

Replace with the LAN IP of your host (e.g., 192.168.0.3). You should see the CouchDB Fauxton dashboard.

Success: If you see the dashboard, your LAN connection is ready for Perfect Management Systems.
Step 8

Configure the Perfect Management System on Client Devices

Once your host is ready, each device must be pointed to the host’s CouchDB server. These instructions apply to any Perfect Management System — Pharmacy, Patient, Ward, Inventory, Billing, Rota, etc.

For Windows Clients
  1. Open the Perfect Management System app.
  2. Go to Settings → Database Settings.
  3. Set Server URL to:
    http://:5984
  4. Enter your CouchDB username and password.
  5. Save settings and restart the app.
For Mac Clients
  1. Launch the Perfect Management System app.
  2. Go to Settings → Database Settings.
  3. Enter the host URL as above, replacing with your host’s IP.
  4. Fill in your CouchDB login credentials.
  5. Save and restart the application.
For Linux Clients
  1. Open the Perfect Management System application.
  2. Go to Settings → Database Settings.
  3. Input http://:5984 as the Server URL.
  4. Provide the CouchDB username and password.
  5. Save changes and restart the app.
For Android Clients
  1. Ensure the device is on the same Wi-Fi as the host.
  2. Open the Perfect Management System app.
  3. Navigate to Settings → Database Settings.
  4. Enter the Server URL http://:5984 and credentials.
  5. Save and restart the app.
Disable "Private Address" in Wi-Fi settings if the app cannot connect.
For iOS Clients (iPhone / iPad)
  1. Connect to the same Wi-Fi as the host.
  2. Launch the Perfect Management System app.
  3. In Settings → Database Settings, enter:
    http://:5984
  4. Provide CouchDB credentials and save.
  5. Restart the app to apply changes.
Step 9

Connecting More Than Two Devices

You can add as many client devices as your network can handle. Simply repeat the client setup steps for each additional device.

Performance Tips
  • Use a wired Ethernet connection for the host.
  • Ensure Wi-Fi clients have strong signal strength.
  • Limit heavy background downloads during operation.
Security Tips
  • Only allow trusted devices on the LAN.
  • Set a strong CouchDB admin password.
  • Regularly check _users database for unknown accounts.

Troubleshooting

Problem Possible Cause Solution
Cannot connect from client device Wrong IP or different subnet Verify host IP and ensure all devices share first three IP octets
Timeout when connecting Firewall blocking port 5984 Check and allow inbound TCP port 5984 on host
Works locally but not remotely bind_address still set to 127.0.0.1 Update to 0.0.0.0 and restart CouchDB
Data syncing slowly Weak Wi-Fi signal or network congestion Use wired connection for host, improve Wi-Fi coverage