How to Deploy ERPNext on Ubuntu Server: A Complete Guide
Deploying ERPNext on an Ubuntu server is one of the best ways to build a flexible, self-hosted ERP system for managing business operations. ERPNext is a powerful open-source ERP software that helps businesses handle accounting, inventory, sales, purchases, HR, CRM, manufacturing, projects, and more from one centralized platform.
Many businesses prefer hosting ERPNext on their own Ubuntu VPS because it gives them more control over performance, privacy, customization, and long-term costs. Instead of depending fully on a shared SaaS platform, a self-hosted ERPNext setup allows you to manage your own server environment, configure resources as per your business needs, and scale when your usage grows.
In this guide, we will explain how to deploy ERPNext on Ubuntu Server in a simple and practical way. Whether you are a developer, business owner, system admin, or someone exploring ERPNext hosting for the first time, this blog will help you understand the process, requirements, and best practices before starting the installation.
What Is ERPNext?
ERPNext is a complete enterprise resource planning system designed for small, medium, and growing businesses. It is built on the Frappe Framework and offers a wide range of business modules such as accounting, stock management, sales, purchase, CRM, HR, payroll, manufacturing, asset management, and project management.
The biggest advantage of ERPNext is that it is open-source. This means businesses can customize it based on their workflow, host it on their own infrastructure, and avoid heavy recurring software licensing costs. For companies that want more freedom and control over their business software, ERPNext is a practical and future-ready solution.
Why Deploy ERPNext on Ubuntu Server?
Ubuntu is one of the most popular Linux operating systems for server deployment. It is stable, widely supported, secure, and beginner-friendly compared to many other Linux distributions. When you combine ERPNext with an Ubuntu server, you get a reliable environment for running your ERP application smoothly.
An ERPNext Ubuntu Server setup is useful because it allows you to control server resources like CPU, RAM, storage, database configuration, backups, SSL, and security settings. This becomes especially important when multiple users access the ERP system daily or when your business data grows over time.
Hosting ERPNext on an Ubuntu VPS also gives better flexibility. You can increase server resources, configure custom domains, add SSL certificates, schedule backups, and install monitoring tools as per your requirement.
Basic Server Requirements for ERPNext
Before starting the ERPNext installation on Ubuntu, you should make sure your server has enough resources. ERPNext is not a small static website; it is a full business application with database, background jobs, real-time updates, file storage, and multiple services.
For a small business or testing environment, you can start with:
- 2 CPU cores
- 4 GB RAM
- 40 GB SSD/NVMe storage
- Ubuntu 22.04 LTS or Ubuntu 24.04 LTS
- Root or sudo access
- A domain name pointing to the server IP
For production usage, especially with multiple employees, accounting data, stock entries, reports, and attachments, it is better to use higher resources such as 4 CPU cores, 8 GB RAM, and fast SSD/NVMe storage.
Step 1: Update the Ubuntu Server
The first step in any Ubuntu server setup is updating the system packages. This helps ensure that your server has the latest security patches and package updates.
You can run:
sudo apt update && sudo apt upgrade -y
After updating the system, reboot the server if required:
sudo reboot
This is a basic but important step before installing ERPNext because outdated packages may create dependency issues during installation.
Step 2: Create a New User for ERPNext
It is not recommended to run all ERPNext services directly as the root user. A separate system user should be created for better security and cleaner server management.
Example:
sudo adduser frappe
sudo usermod -aG sudo frappe
Now switch to the new user:
su - frappe
Using a dedicated user helps keep the ERPNext environment organized and reduces the risk of accidentally changing important system-level files.
Step 3: Install Required Dependencies
ERPNext depends on several components such as Python, Node.js, Redis, MariaDB, Yarn, wkhtmltopdf, and other development tools. These services work together to run the application, process background jobs, manage the database, generate PDFs, and handle frontend assets.
Common packages required include:
sudo apt install git python3-dev python3-pip python3-venv redis-server mariadb-server mariadb-client curl software-properties-common -y
You will also need Node.js and Yarn. ERPNext uses Node.js for frontend asset building and real-time features. It is better to install a supported Node.js version based on the ERPNext/Frappe version you are deploying.
Step 4: Configure MariaDB Database
ERPNext uses MariaDB as the database. Since ERP software stores sensitive business data, database configuration is very important.
First, secure the MariaDB installation:
sudo mysql_secure_installation
During the setup, you can remove anonymous users, disallow remote root login, remove the test database, and reload privilege tables.
Next, open the MariaDB configuration file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Add or verify important settings such as character set and collation:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
Also add:
[mysql]
default-character-set = utf8mb4
Restart MariaDB:
sudo systemctl restart mariadb
This helps ERPNext support multiple languages, special characters, and business data without encoding issues.
Step 5: Install Frappe Bench
Frappe Bench is a command-line tool used to install, manage, and deploy Frappe-based applications like ERPNext. It helps create sites, install apps, manage updates, configure production services, and control the development environment.
Install Bench using pip:
pip3 install frappe-bench
Check if Bench is installed:
bench --version
If the command returns a version number, Bench is installed successfully.
Step 6: Initialize a New Frappe Bench
Now you can initialize a new Frappe Bench environment. This will download the Frappe Framework and prepare the base structure.
Example:
bench init frappe-bench
cd frappe-bench
This process may take some time because it downloads dependencies and sets up the project environment.
After initialization, you will have a directory called frappe-bench, which contains apps, sites, logs, configuration files, and environment settings.
Step 7: Create a New ERPNext Site
ERPNext uses a site-based structure. A site is like a separate ERP instance with its own database and configuration.
Create a new site:
bench new-site yourdomain.com
You will be asked to enter the MariaDB root password and create an administrator password for ERPNext.
The administrator password is important because it will be used to log in to the ERPNext dashboard after installation.
Step 8: Download and Install ERPNext App
After creating the site, you need to download the ERPNext app into your Bench environment.
Example:
bench get-app erpnext
Then install ERPNext on your site:
bench --site yourdomain.com install-app erpnext
Once this step is completed, ERPNext will be installed on your Ubuntu server. At this stage, the application is available in a development mode, but it still needs production setup for real business use.
Step 9: Test ERPNext Locally
Before setting up production, you can test whether ERPNext is running properly.
Use:
bench start
Now open the server IP with the running port in your browser. If everything is installed correctly, you should see the ERPNext login screen.
This test confirms that your ERPNext server setup is working before moving to production configuration.
Step 10: Configure ERPNext for Production
For production use, ERPNext should run with Nginx and Supervisor. Nginx works as the web server and reverse proxy, while Supervisor manages background processes and keeps services running.
Run:
sudo bench setup production frappe
This command configures ERPNext for production usage. It creates necessary process files, sets up Nginx configuration, and prepares the server to serve ERPNext properly through your domain.
After setup, restart services:
sudo supervisorctl restart all
sudo systemctl reload nginx
Now your ERPNext site should be accessible through your domain name.
Step 11: Point Your Domain to the Server
To access ERPNext with a proper domain, you need to point your domain’s DNS records to the server IP.
Create an A record like this:
Type: A
Name: erp
Value: your-server-ip
For example:
erp.example.com → 123.123.123.123
DNS propagation may take a few minutes to a few hours depending on your domain provider.
Using a subdomain such as erp.yourdomain.com is a clean option because it separates your ERP system from your main website.
Step 12: Install SSL Certificate
SSL is necessary for any ERP system because it protects login details, customer records, invoices, employee data, and business transactions.
You can enable SSL using Let’s Encrypt:
sudo bench setup lets-encrypt yourdomain.com
After SSL is installed, your ERPNext site should open with HTTPS.
A secure ERPNext hosting setup should always use HTTPS, especially when users access it from different locations or public networks.
Step 13: Enable Backups
ERPNext stores important business data, so backups are not optional. You should configure regular backups for both the database and files.
ERPNext has built-in backup commands:
bench --site yourdomain.com backup
You can also configure automatic backups and store them on remote storage. Ideally, backups should not stay only on the same server. If the server fails, local backups may also become inaccessible.
A good backup strategy should include:
- Daily database backups
- File backups
- Remote backup storage
- Backup retention policy
- Regular restore testing
Many businesses set up backups but never test restoration. That is risky. A backup is only useful if it can be restored successfully.
Step 14: Improve Server Security
After you deploy ERPNext on Ubuntu Server, security should be a top priority. ERPNext contains sensitive business data, so your server should be hardened properly.
Important security steps include:
- Disable direct root SSH login
- Use SSH keys instead of passwords
- Change the default SSH port if required
- Enable firewall using UFW
- Allow only required ports
- Keep Ubuntu packages updated
- Use strong ERPNext admin passwords
- Enable regular backups
- Monitor failed login attempts
Basic firewall setup:
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
This allows SSH and web traffic while blocking unnecessary access.
Step 15: Monitor Performance
ERPNext performance depends on server resources, database health, background workers, and user activity. If your ERP becomes slow, it may affect daily operations like billing, stock entry, purchase orders, and reporting.
You should monitor:
- CPU usage
- RAM usage
- Disk space
- Database size
- Background job queue
- Nginx logs
- ERPNext error logs
- Backup status
Useful commands:
htop
df -h
free -m
bench doctor
The bench doctor command helps check whether background workers and scheduler are running properly.
Common Issues During ERPNext Installation on Ubuntu
While doing ERPNext installation on Ubuntu, users may face some common errors. Most of them happen because of missing dependencies, incorrect Node.js versions, MariaDB configuration issues, or permission problems.
Some common issues include:
1. Bench command not found
This usually means Bench was not installed properly or the local Python binary path is not available in the shell.
2. MariaDB access denied
This can happen when the database root password is incorrect or MariaDB authentication is not configured properly.
3. Site not opening after production setup
Check Nginx status:
sudo systemctl status nginx
Also check Supervisor:
sudo supervisorctl status
4. SSL installation failure
SSL may fail if the domain is not properly pointed to the server IP. Always verify DNS before running the Let’s Encrypt command.
5. Slow ERPNext dashboard
This may happen due to low RAM, high database usage, or background workers not running correctly. For production, avoid using very low-resource servers.
Best Practices for ERPNext Hosting
A stable ERPNext hosting setup is not only about installation. Long-term performance depends on maintenance, updates, monitoring, and backups.
Follow these best practices:
- Use an Ubuntu LTS version
- Choose SSD or NVMe storage
- Use at least 4 GB RAM for small production usage
- Keep ERPNext and Frappe updated carefully
- Take backups before every update
- Use a dedicated domain or subdomain
- Enable SSL from day one
- Monitor logs regularly
- Avoid installing unnecessary software on the same server
- Use remote backup storage
Should You Use Shared Hosting for ERPNext?
ERPNext should not be hosted on normal shared hosting. It requires background workers, Redis, MariaDB configuration, Python environment, Node.js, scheduled jobs, and production process management. Shared hosting usually does not provide the level of control required for these services.
An Ubuntu VPS is a better option because it gives root access, dedicated resources, custom configuration, and better scalability. This makes VPS hosting more suitable for ERPNext deployment.
When Should You Upgrade Your Server?
As your business grows, ERPNext usage also increases. More users, more invoices, more stock entries, more reports, and more attachments can increase server load.
You should consider upgrading your server when:
- ERPNext dashboard becomes slow
- Reports take too long to load
- CPU usage stays high
- RAM usage is constantly above 80%
- Disk space is filling quickly
- Background jobs are delayed
- Multiple users face slow response time
A server with better CPU, higher RAM, and NVMe storage can improve ERPNext performance significantly.
Final Thoughts
Learning how to deploy ERPNext on Ubuntu Server is useful for any business that wants more control over its ERP system. ERPNext is flexible, open-source, and powerful, but it needs a properly configured server environment to run smoothly.
A clean ERPNext Ubuntu Server setup includes updated Ubuntu packages, MariaDB, Redis, Node.js, Frappe Bench, Nginx, Supervisor, SSL, backups, and basic server security. When each part is configured correctly, ERPNext can become a reliable system for managing accounting, inventory, sales, HR, CRM, and other business operations.
For production use, always choose a server with enough resources, secure the environment, configure automated backups, and monitor performance regularly. A well-managed Ubuntu VPS can provide the stability and flexibility required for long-term ERPNext hosting. For more guidance, you can contact VPS9.
With the right setup, ERPNext can help businesses move away from scattered tools and manage their operations from one centralized, customizable, and scalable ERP platform.