Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The most reproducible way to self-host Monica Personal CRM on an Ubuntu VPS is Docker Compose with Monica’s Apache image and a MariaDB container. Put the application behind a TLS-terminating reverse proxy, set APP_ENV=production, generate a unique APP_KEY, and persist both Monica’s storage directory and the database volume. This gives you a private relationship-management server without paying for the separate hosted service.

This guide answers the practical questions directly: how to self-host Monica on Ubuntu, which Compose services and environment variables are required, how much RAM to provision, how to finish the first-run setup, and how to expose the installation safely over HTTPS. It also covers a manual PHP installation for people who do not want containers.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are deploying

A working self-hosted Monica installation has four parts:

  • An Ubuntu VPS with Docker Engine and the Docker Compose plugin.
  • A Monica application container. The Apache variant serves HTTP inside the container; the FPM variant requires a separate web server.
  • A MySQL-compatible database. Monica supports MySQL and MariaDB; the examples below use MariaDB.
  • Persistent storage for Monica’s application files and persistent database data.

The application container should not be treated as the database. If you recreate containers without persistent volumes, contacts, notes, reminders and other records can disappear. Monica’s application data is stored under /var/www/html/storage; the database needs its own volume as well.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Monica is free software that you can run on your own server. The hosted Monica offering is a separate paid service, so self-hosting means you take responsibility for the VPS, updates, TLS, credentials and backups.

Choose Docker Compose or a manual PHP installation

Docker Compose is the better default for most VPS deployments because the application and database are described together, can be recreated consistently and keep most package details inside containers. Manual installation gives you more control over host packages and the web server, but every PHP, Composer, database and operating-system update becomes your responsibility.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision point Docker Compose Manual installation
Setup reproducibility Usually stronger: application and database are declared as services. Depends on the exact Ubuntu, PHP, extension and web-server configuration.
Control of host packages Less host-level control; most application components are containerized. More control over PHP, the HTTP server and system packages.
Reverse-proxy complexity Apache image is simplest when placed behind a proxy; FPM requires a separate proxy/web server. You configure Apache, Nginx or Caddy directly.
Updates and backups You still must update images, run migrations and back up both volumes. You still must update PHP/application files and back up the database and storage.

The rest of this article uses Docker Compose. The manual path appears later for readers who specifically need it.

VPS requirements and RAM guidance

The Monica project README recommends at least 1.5 GB of RAM for successful builds and hosting. The reason matters: normal runtime use can be lighter, but dependency installation and update builds may fail on smaller machines. Treat 1.5 GB as the project’s documented floor for a reliable installation rather than as a performance guarantee.

Choose an Ubuntu release that your VPS provider currently supports, a public IPv4 or IPv6 address, a domain name you control, and enough disk space for the operating system, container layers, MariaDB data, Monica storage and backup copies. No universal CPU, disk or bandwidth requirement is published; those depend on contact volume, attachments, log retention and backup policy.

Before installing anything, record these values:

  • The VPS address and the DNS name you will use, such as crm.example.com.
  • A long, unique database password and a separate MariaDB root password.
  • A generated Monica APP_KEY.
  • The location where encrypted off-site backups will be kept.

Install Docker and Compose on Ubuntu

Use the Docker installation route supported for your Ubuntu release, then verify both Docker Engine and the Compose plugin. Package names can vary between Ubuntu releases, so do not blindly substitute an unrelated third-party package.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Update Ubuntu’s package index and install Docker Engine and the Compose plugin using the release-supported Docker packages.
  2. Enable and start the Docker service.
  3. Add your deployment account to the docker group if you want to run Compose without sudo, then start a new login session so the group change takes effect.
  4. Verify the installation with docker --version, docker compose version and a disposable hello-world container.

Do not expose the Docker daemon’s remote API to the internet. The Compose project should be managed locally on the VPS over SSH.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Create a private Monica project directory

Create a directory that is readable by the deployment account but is not a public web directory. Store the Compose file and its environment file there:

mkdir -p ~/monica
cd ~/monica
touch .env
chmod 600 .env

The .env file contains secrets and must not be committed to a public repository or pasted into a support ticket. If you keep the Compose file in version control, commit only a sanitized example and inject real values on the VPS.

Generate the Monica application key

Monica uses APP_KEY for application encryption. Generate it on the VPS with the pattern documented by the project:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
echo -n 'base64:'; openssl rand -base64 32

Copy the complete output, including the base64: prefix, into .env. Do not invent a key, reuse one from another installation or casually rotate it after storing encrypted data; changing an encryption key can make existing encrypted values unreadable.

Generate database credentials

Use long random values for the application database user and the MariaDB root account. Keep the application user separate from the root account. A typical .env file has this shape:

APP_KEY=base64:replace-with-the-generated-value
DB_DATABASE=monica
DB_USERNAME=monica
DB_PASSWORD=replace-with-a-long-random-password
MARIADB_ROOT_PASSWORD=replace-with-a-different-long-random-password

The names above are variable names, not passwords. Replace every value before starting the stack.

Compose file for Monica and MariaDB

The official Compose pattern uses two services: Monica and MariaDB. The following file shows the required relationships, environment variables and persistent mounts. Use the exact Monica image tag and database image tag validated for your deployment; pinning known tags is preferable to silently accepting a future breaking change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
services:
app:
image: monica:apache
restart: unless-stopped
depends_on:
- db
ports:
- '127.0.0.1:8080:80'
environment:
APP_ENV: production
APP_KEY: ${APP_KEY}
DB_HOST: db
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
volumes:
- monica_storage:/var/www/html/storage

db:
image: mariadb
restart: unless-stopped
environment:
MARIADB_DATABASE: ${DB_DATABASE}
MARIADB_USER: ${DB_USERNAME}
MARIADB_PASSWORD: ${DB_PASSWORD}
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
volumes:
- monica_database:/var/lib/mysql

volumes:
monica_storage:
monica_database:

The Apache image is deliberately bound to 127.0.0.1 in this example. That lets a reverse proxy on the same VPS reach Monica while preventing a direct public connection to the application port. Do not add a public database port mapping. MariaDB should be reachable only over the private Compose network.

If the official example you are following uses a different image tag, environment variable or health-check arrangement, preserve that documented value rather than mixing versions from unrelated examples. The important invariants are the two services, the database host name db, a strong key, and persistent mounts.

Start Monica and complete first-run setup

  1. From ~/monica, check the rendered configuration without printing secrets into a shared terminal or log.
  2. Start the services in the background with docker compose up -d.
  3. Watch the application and database logs while MariaDB initializes. The first start can take longer than later restarts because the database has to create its schema.
  4. Wait for the migration process to finish before creating the first account. Opening the site while migrations are still running can produce connection or missing-table errors that resolve after initialization.
  5. Run the production setup command once after the initial start: docker compose exec app php artisan setup:production.
  6. Open Monica through the local proxy endpoint or your eventual domain and create the first user account.

Do not run the production setup command repeatedly as a routine health check. Record that it was completed, and run it again only when Monica’s documented upgrade procedure specifically requires it.

What to verify before calling the installation complete

  • The application container is running and can resolve the database service name db.
  • The browser can load the login page and the first account can sign in.
  • A test contact, note and reminder survive an application-container restart.
  • The named volumes appear in docker volume ls.
  • No database port is exposed on the VPS’s public interface.

Put Monica behind HTTPS

The basic Compose port mapping is not a finished public deployment. Monica’s documentation states that internet exposure requires APP_ENV=production and HTTPS, normally supplied by a reverse proxy on the host or in another container. The Apache Compose example serves HTTP itself but does not provide SSL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DNS and proxy layout

  1. Create a DNS record for your chosen hostname that points to the VPS address.
  2. Keep Monica bound to a loopback address such as 127.0.0.1:8080, or place the proxy and app on a private Docker network.
  3. Configure the reverse proxy to accept HTTP and HTTPS for the hostname, redirect plain HTTP to HTTPS, and forward HTTPS requests to the Monica HTTP endpoint.
  4. Obtain and renew a certificate using the proxy’s supported certificate mechanism.
  5. Forward the original host and protocol headers so Monica can generate correct secure URLs.

A host-level Nginx proxy typically forwards to http://127.0.0.1:8080 and sets Host, X-Forwarded-For and X-Forwarded-Proto. Exact directive names and certificate commands depend on your Ubuntu release and proxy, so validate the configuration with that software’s current documentation rather than copying an obsolete TLS recipe.

HTTPS checks

  • Visit the domain in a private browser window and confirm the address remains HTTPS after login.
  • Inspect the certificate name and expiration date.
  • Confirm that HTTP redirects to HTTPS instead of serving a second, unsecured Monica session.
  • Check that links, form submissions and redirects do not switch back to an HTTP URL.
  • Ensure the proxy is the only service listening publicly on ports 80 and 443; the database must remain private.

Firewall, secrets and update hygiene

Use a host firewall policy that permits SSH and the web ports required by your reverse proxy, while denying unsolicited access to MariaDB and the internal application port. Firewall rules are operational choices rather than Monica-specific requirements, so document which administration address or VPN is allowed to reach SSH.

Keep Ubuntu packages, Docker Engine, the Compose plugin, Monica’s image and the database image updated. Read Monica’s upgrade notes before changing image tags: migrations may need to run, and a database backup should exist before any upgrade. Never delete named volumes as part of a routine image refresh.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Protect .env, SSH keys and backup archives. A VPS compromise can expose both the application and its secrets, so use a separate administrative account, disable password-only SSH where practical, and limit who can read the project directory.

Back up Monica correctly

A usable backup must include both kinds of persistent data: the MariaDB database and Monica’s application storage. Copying only the Compose file does not preserve contacts or attachments, and copying only the database may omit files stored under /var/www/html/storage.

Database backup

Use the database client inside the running container and write the dump to a protected directory outside the database volume. The exact client binary can vary with the MariaDB image, but a typical pattern is:

mkdir -p ~/monica-backups
docker compose exec -T db mariadb-dump -u"$DB_USERNAME" -p"$DB_PASSWORD" "$DB_DATABASE" > ~/monica-backups/monica-$(date +%F).sql

If the variables are stored only in .env, load them in a controlled shell session or substitute them without exposing the password in shared process listings. Keep the resulting SQL file encrypted and restrict its permissions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Application-storage backup

Stream Monica’s storage directory into an archive from the application container:

docker compose exec -T app tar czf - -C /var/www/html/storage . > ~/monica-backups/monica-storage-$(date +%F).tgz

Copy both backup files to encrypted off-site storage, retain more than one restore point, and test a restore on a separate environment. The project documentation establishes that storage and database data must persist; backup frequency, retention and provider are choices you should document for your own recovery objective.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Manual installation without containers

Manual installation is supported when you do not want Docker. The Monica project README lists these prerequisites:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
  • PHP 8.1 or newer.
  • An HTTP server with PHP support, such as Apache, Nginx or Caddy.
  • Composer.
  • MySQL.

The README recommends at least 1.5 GB of RAM because update builds can fail on smaller systems even when ordinary runtime use is lighter. Provision the database separately or on the same VPS, configure the web server’s document root according to Monica’s release instructions, create the required database and user, install Composer dependencies, set the application key and run the documented production setup and migration commands.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Manual deployment changes the failure boundary. You must track PHP extensions, Composer versions, web-server permissions, process restarts, TLS configuration and application updates yourself. Backups still need both the database and Monica’s storage directory. If your main goal is a reproducible VPS rebuild, Compose is usually the lower-maintenance choice; if host-level PHP control is more important, manual installation can be appropriate.

Troubleshooting common failures

The app cannot connect to MariaDB

Check that the database service is running, that DB_HOST is exactly db, and that the database name, username and password match the MariaDB environment values. A container restart during first initialization is normal; inspect logs and wait for the database to finish creating its data directory before restarting the application repeatedly.

The browser shows a gateway error

Confirm that the proxy’s upstream matches the published loopback port, that the application container is running, and that Ubuntu’s firewall permits the proxy-to-app path. If the proxy is in another container, 127.0.0.1 points to the proxy container itself, not the Monica container; use a shared Docker network and the application service name instead.

Data vanished after a redeploy

Check that the Compose project still references the same named volumes and that no command removed them. Recreating a container is safe when the volumes remain attached; deleting a volume is destructive. Restore the database dump and storage archive if the original volumes are unavailable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Setup reports encryption or key errors

Verify that APP_KEY is present, includes the generated prefix and is identical to the key used when the data was created. Do not generate a new key merely to silence an error on an existing installation; investigate the missing or unreadable environment file first.

An update fails during dependency or build work

Compare the VPS memory with the project’s 1.5 GB recommendation, inspect container logs, and verify that the image and database versions are compatible with the upgrade instructions. Take a tested backup before trying another upgrade. Increasing resources may solve a build-time failure, but it does not replace following Monica’s migration procedure.

HTTPS redirects loop or links use HTTP

Make sure the proxy forwards the original protocol header, the public hostname is consistent, and Monica is configured for production mode. Check that the proxy terminates TLS once and forwards plain HTTP internally; do not create a second conflicting redirect in the application container.

Maintenance checklist

  • Keep a written record of the domain, VPS address, Compose directory and volume names.
  • Store APP_KEY and database credentials in a protected secret location.
  • Apply Ubuntu, Docker, Monica and database updates on a schedule appropriate to your risk tolerance.
  • Back up the database and application storage before upgrades.
  • Copy backups off the VPS and perform a restore test.
  • Monitor disk space, memory pressure, certificate expiration and container health.
  • Review firewall rules and remove unused public listeners.
  • Document the recovery steps on a second device so a failed VPS is not your only copy of the instructions.

Version expectations

Monica’s official pricing page describes Monica v3 as coming before the end of 2026. That is a dated product statement, not a guarantee that every release or migration will occur on a particular day. Check the project’s current release and upgrade documentation before changing image tags or applying a major-version update.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a new Ubuntu VPS, the safest sequence remains: establish persistent storage, configure a generated key and private database credentials, start the two-service Compose stack, finish production setup, then publish it through a properly configured HTTPS reverse proxy. The same order makes a later rebuild or migration much easier to verify.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.