Google Workspace Replacement

Complete self-hosted Google Workspace replacement with Jitsi Meet, Nextcloud, and Email Suite

Overview

This deployment provides a complete self-hosted Google Workspace replacement optimized for a small homelab (1-2 users) with smart home integration.

Services Included

πŸŽ₯ Jitsi Meet - Video Conferencing (meet.home.dodwell.us)

  • Components: Web UI, Jicofo, JVB, Prosody XMPP, Jigasi SIP Gateway
  • Features:
    • Video conferencing optimized for 1-2 users
    • SIP integration with Asterisk PBX at 192.168.1.202:5060
    • Doorbell integration via Home Assistant
    • Mobile and desktop app support

☁️ Nextcloud - File Storage & Office Suite (cloud.home.dodwell.us)

  • Components: Nextcloud, PostgreSQL, Redis, OnlyOffice DocumentServer
  • Features:
    • File storage and synchronization
    • Online document editing with OnlyOffice
    • Calendar and contacts sync
    • Mobile apps support
    • Optimized for small homelab usage

πŸ“§ Email Suite - Complete Email Solution (mail.home.dodwell.us)

  • Components: Docker Mailserver, SOGo Groupware, MySQL
  • Features:
    • Full SMTP/IMAP/POP3 email server
    • Web-based email client (SOGo)
    • Calendar and contacts via SOGo
    • Spam filtering and virus scanning
    • DKIM/SPF/DMARC support

🏠 Smart Home Integration

  • Reolink Doorbell Integration:
    • Auto-creates Jitsi rooms on doorbell press
    • Calls Cisco phone via Asterisk SIP
    • Captures photos and video clips
    • Sends notifications via Telegram
    • Motion detection and alerts

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    K3s Cluster Network                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Jitsi Meet        β”‚   Nextcloud     β”‚   Email Suite       β”‚
β”‚   (Video Conf)      β”‚   (Files/Office)β”‚   (Mail/Calendar)   β”‚
β”‚                     β”‚                 β”‚                     β”‚
β”‚ β€’ Web UI            β”‚ β€’ Nextcloud     β”‚ β€’ Docker Mailserverβ”‚
β”‚ β€’ Prosody XMPP      β”‚ β€’ PostgreSQL    β”‚ β€’ SOGo Groupware   β”‚
β”‚ β€’ Jicofo            β”‚ β€’ Redis         β”‚ β€’ MySQL            β”‚
β”‚ β€’ JVB               β”‚ β€’ OnlyOffice    β”‚                     β”‚
β”‚ β€’ Jigasi (SIP)      β”‚                 β”‚                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  External Integrations                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Asterisk PBX    β”‚ Home Assistant  β”‚ Storage & Network       β”‚
β”‚ (192.168.1.202) β”‚ (Automation)    β”‚                         β”‚
β”‚                 β”‚                 β”‚                         β”‚
β”‚ β€’ Cisco Phones  β”‚ β€’ Reolink       β”‚ β€’ TrueNAS NFS/iSCSI    β”‚
β”‚ β€’ SIP Gateway   β”‚   Doorbell      β”‚   (192.168.1.6)        β”‚
β”‚ β€’ Jigasi Bridge β”‚ β€’ Telegram Bot  β”‚ β€’ MetalLB LoadBalancer  β”‚
β”‚ β€’ Extensions    β”‚ β€’ Automations   β”‚ β€’ nginx Ingress         β”‚
β”‚   1000-1002     β”‚                 β”‚ β€’ cert-manager (LE)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Prerequisites

Infrastructure Requirements

  • K3s cluster with at least 1 master + 1 worker node
  • TrueNAS at 192.168.1.6 with NFS exports configured
  • Asterisk PBX at 192.168.1.202 (already configured)
  • Home Assistant deployed and configured
  • MetalLB for LoadBalancer services
  • nginx Ingress Controller
  • cert-manager for SSL certificates

DNS Configuration

Ensure these DNS records point to your K3s ingress:

  • meet.home.dodwell.us
  • cloud.home.dodwell.us
  • mail.home.dodwell.us
  • onlyoffice.home.dodwell.us

Storage Preparation

Create NFS exports on TrueNAS (192.168.1.6):

# On TrueNAS, create these datasets (matching existing pattern):
/mnt/tank/nfs/nextcloud/data/
/mnt/tank/nfs/nextcloud/config/
/mnt/tank/nfs/nextcloud/postgres/
/mnt/tank/nfs/nextcloud/redis/
/mnt/tank/nfs/mailcow/data/
/mnt/tank/nfs/mailcow/mysql/
/mnt/tank/nfs/mailcow/redis/
/mnt/tank/nfs/mailcow/solr/

ArgoCD Deployment

Added Applications

The following ArgoCD applications have been added to k3s/envs/local/:

  • jitsi-meet.yaml - Video conferencing with SIP integration
  • nextcloud.yaml - File storage and office suite
  • mailcow.yaml - Complete email solution

Deployment Options

Option 1: Sync All Applications

# Sync the entire local environment (includes new apps)
kubectl apply -k k3s/envs/local/

Option 2: Sync Individual Applications

# Sync each application individually
argocd app sync jitsi-meet
argocd app sync nextcloud
argocd app sync mailcow
# Enable auto-sync for the new applications
argocd app set jitsi-meet --sync-policy automated --auto-prune --self-heal
argocd app set nextcloud --sync-policy automated --auto-prune --self-heal
argocd app set mailcow --sync-policy automated --auto-prune --self-heal

Manual Deployment Instructions

Step 1: Deploy Jitsi Meet

# Deploy base Jitsi Meet stack
kubectl apply -k k3s/apps/jitsi-meet/overlays/local/

# Verify deployment
kubectl get pods -n jitsi-meet
kubectl get ingress -n jitsi-meet

# Check Jigasi SIP connection to Asterisk
kubectl logs -n jitsi-meet deployment/jigasi

Step 2: Configure Asterisk for Jigasi

The Asterisk configuration has been updated to include the Jigasi user:

# Apply updated Asterisk configuration
kubectl apply -k k3s/apps/asterisk/overlays/local/

# Restart Asterisk to load new config
kubectl rollout restart deployment/asterisk -n telephony

Step 3: Deploy Nextcloud

# Deploy Nextcloud with OnlyOffice
kubectl apply -k k3s/apps/nextcloud/overlays/local/

# Wait for all pods to be ready
kubectl wait --for=condition=ready pod -l app=nextcloud -n nextcloud --timeout=300s

# Get admin password
kubectl get secret nextcloud-secret -n nextcloud -o jsonpath='{.data.nextcloud-admin-password}' | base64 -d

Step 4: Deploy Email Suite

# Deploy email server and SOGo
kubectl apply -k k3s/apps/mailcow/overlays/local/

# Check email server status
kubectl get pods -n mailcow
kubectl logs -n mailcow deployment/mailserver

# Verify SOGo web interface
kubectl get ingress -n mailcow

Step 5: Configure Home Assistant Doorbell Integration

  1. Deploy updated Home Assistant configuration:
kubectl apply -k k3s/apps/home-assistant/overlays/local/
  1. Set up Telegram Bot:

    • Create bot with @BotFather
    • Get bot token and chat ID
    • Update Home Assistant secrets
  2. Configure Reolink Doorbell:

    • Ensure doorbell is accessible at 192.168.1.205
    • Update IP address in Home Assistant secrets if different
    • Test camera stream and API access
  3. Test Integration:

# Trigger test automation
kubectl exec -n home-assistant deployment/home-assistant -- \
  python -m homeassistant.scripts.check_config

Configuration

Jitsi Meet Configuration

  • Domain: meet.home.dodwell.us
  • SIP Gateway: Integrated with Asterisk at 192.168.1.202:5060
  • User: jigasi with password jigasi123
  • Resource Limits: Optimized for 1-2 concurrent users
  • Features: Lobby enabled, recording disabled, optimized bandwidth

Nextcloud Configuration

  • Admin User: admin / nextcloud123
  • Database: PostgreSQL with performance optimizations
  • Cache: Redis for improved performance
  • OnlyOffice: Document collaboration with JWT security
  • Storage: NFS backend for scalability
  • Apps: Essential apps pre-installed

Email Configuration

  • Domain: home.dodwell.us
  • Accounts:
    • admin@home.dodwell.us / admin123
    • michael@home.dodwell.us / michael123
    • user@home.dodwell.us / user123
  • Features: IMAP/SMTP/POP3, webmail via SOGo
  • Security: DKIM, SPF, spam filtering, virus scanning

Home Assistant Doorbell Automation

  • Trigger: Reolink doorbell button press or motion
  • Actions:
    1. Capture photo (2s delay) and video (10s duration)
    2. Create Jitsi room with timestamp name
    3. Call Cisco phone (extension 1000) via Asterisk
    4. Send Telegram notification with media and room link
    5. Cleanup old media files (7-day retention)

Usage

Video Conferencing

  1. Web Access: Visit https://meet.home.dodwell.us
  2. Doorbell Integration:
    • Press doorbell β†’ auto-creates room
    • Cisco phone rings automatically
    • Telegram notification with room link
  3. SIP Integration: Dial into rooms from any SIP client

File Storage & Office

  1. Web Access: Visit https://cloud.home.dodwell.us
  2. Login: admin / nextcloud123
  3. Document Editing: Click any Office document to edit with OnlyOffice
  4. Mobile Apps: Install Nextcloud mobile apps
  5. Desktop Sync: Install Nextcloud desktop client

Email & Calendar

  1. Webmail: Visit https://mail.home.dodwell.us
  2. Email Clients:
    • IMAP: mail.home.dodwell.us:993 (SSL)
    • SMTP: mail.home.dodwell.us:587 (STARTTLS)
  3. Calendar/Contacts: Available in SOGo web interface
  4. Mobile Sync: Use SOGo ActiveSync (if enabled)

Telegram Bot Setup

1. Create Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Start a chat with BotFather
  3. Send /newbot command
  4. Choose a name for your bot (e.g., “Homelab Doorbell Bot”)
  5. Choose a username (e.g., “homelab_doorbell_bot”)
  6. BotFather will give you an API token - save this as telegram_bot_token

2. Get Your Chat ID

  1. Start a chat with your new bot
  2. Send any message to the bot
  3. Open this URL in your browser (replace TOKEN with your bot token):
    https://api.telegram.org/botTOKEN/getUpdates
    
  4. Look for the chat.id in the response - save this as telegram_chat_id

3. Update Home Assistant Secrets

Create/update the secrets in Home Assistant:

# In secrets.yaml or as environment variables
telegram_bot_token: "1234567890:ABCdefGHIjklMNOpqrsTUVwxyz"
telegram_chat_id: "123456789"

Monitoring

Prometheus Metrics

All services expose metrics for Prometheus monitoring:

# Check ServiceMonitor resources
kubectl get servicemonitor -A

# View metrics endpoints
kubectl get endpoints -A | grep metrics

Log Aggregation

# View service logs
kubectl logs -n jitsi-meet deployment/web
kubectl logs -n nextcloud deployment/nextcloud
kubectl logs -n mailcow deployment/mailserver
kubectl logs -n home-assistant deployment/home-assistant

Health Checks

# Check all service health
kubectl get pods -A | grep -E "(jitsi-meet|nextcloud|mailcow)"

# Test ingress endpoints
curl -I https://meet.home.dodwell.us
curl -I https://cloud.home.dodwell.us
curl -I https://mail.home.dodwell.us

Troubleshooting

Jitsi Meet Issues

Jigasi not connecting to Asterisk:

# Check Jigasi logs
kubectl logs -n jitsi-meet deployment/jigasi

# Verify Asterisk user
kubectl exec -n telephony deployment/asterisk -- \
  asterisk -rx "pjsip show endpoints"

# Test SIP connectivity
kubectl exec -n jitsi-meet deployment/jigasi -- \
  nc -zv 192.168.1.202 5060

Video/Audio issues:

  • Check JVB UDP port 10000 is accessible
  • Verify STUN servers are reachable
  • Check browser console for WebRTC errors

Nextcloud Issues

OnlyOffice not working:

# Check OnlyOffice connectivity
kubectl exec -n nextcloud deployment/nextcloud -- \
  curl -I http://onlyoffice:80

# Verify JWT configuration
kubectl logs -n nextcloud deployment/onlyoffice

Database connection issues:

# Check PostgreSQL
kubectl exec -n nextcloud deployment/nextcloud-postgres -- \
  pg_isready -U nextcloud

# View database logs
kubectl logs -n nextcloud deployment/nextcloud-postgres

Email Issues

Cannot send/receive email:

# Check mailserver logs
kubectl logs -n mailcow deployment/mailserver

# Test SMTP
kubectl exec -n mailcow deployment/mailserver -- \
  telnet localhost 25

# Check DNS records
dig MX home.dodwell.us
dig TXT home.dodwell.us

SOGo web interface not loading:

# Check SOGo logs
kubectl logs -n mailcow deployment/sogo

# Test database connection
kubectl exec -n mailcow deployment/sogo-mysql -- \
  mysql -u sogo -psogo123 -e "SELECT * FROM sogo.sogo_view;"

Home Assistant Issues

Doorbell automation not triggering:

# Check Home Assistant logs
kubectl logs -n home-assistant deployment/home-assistant

# Test Reolink connectivity
kubectl exec -n home-assistant deployment/home-assistant -- \
  curl -I http://192.168.1.205

# Verify automation state
kubectl exec -n home-assistant deployment/home-assistant -- \
  python -c "
import requests
r = requests.get('http://localhost:8123/api/states/automation.doorbell_button_pressed')
print(r.json())
"

Telegram notifications not working:

  • Verify bot token and chat ID in secrets
  • Check bot permissions with @BotFather
  • Test bot manually: https://api.telegram.org/botTOKEN/sendMessage?chat_id=CHATID&text=test

Backup Strategy

Database Backups

# Nextcloud PostgreSQL
kubectl exec -n nextcloud deployment/nextcloud-postgres -- \
  pg_dump -U nextcloud nextcloud > nextcloud-backup.sql

# SOGo MySQL  
kubectl exec -n mailcow deployment/sogo-mysql -- \
  mysqldump -u sogo -psogo123 sogo > sogo-backup.sql

Configuration Backups

# Export all configurations
kubectl get configmap -A -o yaml > configmaps-backup.yaml
kubectl get secret -A -o yaml > secrets-backup.yaml

Storage Backups

The NFS storage on TrueNAS should be backed up using TrueNAS built-in backup solutions (snapshots, replication, cloud sync).

Security Considerations

Network Security

  • All services use TLS with Let’s Encrypt certificates
  • Internal communication uses cluster DNS
  • Sensitive services behind Authelia (optional)
  • Rate limiting enabled on ingress

Authentication

  • Strong passwords configured for all services
  • JWT tokens for API authentication
  • RBAC configured for Kubernetes resources
  • Regular password rotation recommended

Updates

  • Use latest stable container images
  • Regular security updates via Renovate/Dependabot
  • Test updates in staging environment first
  • Monitor security advisories for all components

Performance Optimization

Resource Allocation

All services are configured with appropriate resource limits for a small homelab:

  • Jitsi Meet: 2-4 GB RAM total
  • Nextcloud: 2-3 GB RAM total
  • Email Suite: 1-2 GB RAM total
  • Storage: NFS provides shared storage across nodes

Scaling

For larger deployments:

  1. Increase replica counts in overlays
  2. Add additional JVB instances for more video streams
  3. Use external databases (PostgreSQL/MySQL cluster)
  4. Implement horizontal pod autoscaling

Support & Maintenance

Regular Maintenance Tasks

  1. Weekly: Check disk usage and logs
  2. Monthly: Update container images
  3. Quarterly: Review and rotate secrets
  4. Annually: Update SSL certificates (automatic with cert-manager)

Monitoring Alerts

Configure alerts for:

  • Pod restarts and failures
  • High resource usage
  • Certificate expiration
  • Storage capacity
  • Service availability

This completes your self-hosted Google Workspace replacement with smart home integration! The system provides enterprise-grade functionality optimized for home use with seamless integration between video conferencing, file storage, email, and home automation.