How To Install Snipe-IT on Ubuntu 24.04 LTS
Asset management is a critical aspect of any IT department’s responsibilities. Keeping track of hardware, software licenses, and equipment assignments can quickly become overwhelming without the right tools. Snipe-IT offers a powerful open-source solution for IT asset management that simplifies inventory tracking and maintenance. In this comprehensive guide, we’ll walk through the complete process of installing Snipe-IT on Ubuntu 24.04 LTS (Noble Numbat), providing you with a robust asset management system that will streamline your IT operations.
This guide is designed for IT administrators, system engineers, and tech-savvy business owners who want to implement a professional asset management solution without the licensing costs of proprietary alternatives. Whether you’re managing a small business network or an enterprise environment, Snipe-IT provides the flexibility and features you need to maintain accurate asset records.
Understanding Snipe-IT and Its Requirements
Snipe-IT is a feature-rich open-source asset management platform designed specifically for IT environments. Unlike simple spreadsheets, Snipe-IT offers a centralized database with a user-friendly web interface for tracking hardware, software licenses, and accessories throughout their lifecycle.
Key features of Snipe-IT include:
- Hardware asset tracking with complete lifecycle management
- License and software management
- Maintenance logging and scheduling
- User and department assignment tracking
- Custom field support for organization-specific needs
- QR/barcode generation for physical asset tagging
- Comprehensive reporting capabilities
- REST API for integration with other systems
For optimal performance on Ubuntu 24.04 LTS, Snipe-IT requires:
- At least 2GB of RAM (4GB recommended for medium-sized deployments)
- 10GB of available storage space
- PHP 8.1 or higher (Ubuntu 24.04 ships with PHP 8.3, which may require specific configuration)
- MySQL or MariaDB database
- Web server (Apache or Nginx)
Snipe-IT excels in scenarios where spreadsheets become unwieldy and error-prone, especially when multiple team members need to update asset information simultaneously.
Prerequisites
Before beginning the installation, ensure you have:
- A fresh installation of Ubuntu 24.04 LTS with root or sudo privileges
- Internet connectivity for downloading packages
- Basic command line knowledge
- A domain name (optional but recommended for production environments)
Let’s start by preparing our server environment for a successful Snipe-IT installation.
Step 1: Setting Up the Server Environment
The first step in our installation process is to update the system and install essential packages. This ensures we have the latest security patches and required dependencies.
# Update package lists and upgrade existing packages
sudo apt update && sudo apt upgrade -y
This command refreshes your package lists and applies any available updates to your system. It’s crucial to start with an updated system to avoid compatibility issues and security vulnerabilities.
Next, let’s configure the timezone to ensure accurate timestamps for your asset records:
# Set the appropriate timezone
sudo timedatectl set-timezone your_timezone
Replace “your_timezone” with your actual timezone (e.g., “America/New_York” or “Europe/London”). You can find a list of available timezones by running timedatectl list-timezones
.
If you plan to access your Snipe-IT installation remotely, consider setting up a basic firewall:
# Install UFW if not already installed
sudo apt install ufw -y
# Allow SSH connections
sudo ufw allow ssh
# Allow HTTP and HTTPS traffic
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Enable the firewall
sudo ufw enable
This firewall configuration allows SSH connections and web traffic while blocking other incoming connections for improved security.
Step 2: Installing PHP and Required Extensions
Snipe-IT relies on PHP and several extensions to function properly. Ubuntu 24.04 LTS comes with PHP 8.3 by default, which we’ll install along with all necessary extensions.
# Install PHP and required extensions
sudo apt install php-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli} -y
This command installs PHP 8.3 with all extensions required by Snipe-IT. Note that some compatibility issues have been reported with PHP 8.3 and the latest version of Snipe-IT, so we might need to address those during configuration.
To verify your PHP installation and check the version:
# Check PHP version
php -v
This should display the installed PHP version (8.3.x) and confirm that PHP is working correctly.
Step 3: Installing Composer
Composer is a dependency management tool for PHP that we’ll use to install and manage Snipe-IT’s dependencies. While Ubuntu’s repositories include Composer, we’ll download the installer directly from the official website to ensure we have the latest version.
# Download Composer installer
wget -O composer-setup.php https://getcomposer.org/installer
# Install Composer globally
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
# Remove the installer file
rm composer-setup.php
# Verify Composer installation
composer -V
The output should confirm successful installation and display the Composer version (e.g., “Composer version 2.8.1”). Having the latest Composer version ensures compatibility with current PHP packages and dependencies.
Step 4: Installing and Securing MariaDB/MySQL
Snipe-IT requires a database to store asset information, user data, and configuration settings. We’ll use MariaDB, which is fully compatible with MySQL and offers excellent performance.
# Install MariaDB
sudo apt install mariadb-server -y
# Secure the MariaDB installation
sudo mysql_secure_installation
When running mysql_secure_installation
, you’ll be prompted to:
- Set a root password (if not already set)
- Remove anonymous users
- Disallow root login remotely
- Remove test database
- Reload privilege tables
Answer “Y” (yes) to all these options for improved security.
Now, let’s create a database and user specifically for Snipe-IT:
# Log in to MariaDB as root
sudo mysql -u root -p
# Create database and user (in MariaDB prompt)
CREATE DATABASE snipeit;
CREATE USER 'snipeituser'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON snipeit.* TO 'snipeituser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace “secure_password” with a strong, unique password for your database user. This dedicated database user provides better security than using the root account for your application.
Step 5: Downloading and Configuring Snipe-IT
Now that we’ve prepared our environment, let’s download and configure Snipe-IT. We’ll use Git to clone the official repository:
# Install Git if not already installed
sudo apt install git -y
# Clone Snipe-IT repository to web directory
cd /var/www
sudo git clone https://github.com/snipe/snipe-it snipe-it
With the repository cloned, let’s configure Snipe-IT:
# Navigate to Snipe-IT directory
cd /var/www/snipe-it
# Create environment configuration file
sudo cp .env.example .env
# Edit the configuration file
sudo nano .env
Within the .env file, update the following settings:
APP_URL=http://your_domain_or_ip
APP_TIMEZONE='Your/Timezone'
DB_DATABASE=snipeit
DB_USERNAME=snipeituser
DB_PASSWORD=secure_password
Replace “your_domain_or_ip” with your server’s domain name or IP address, “Your/Timezone” with your actual timezone, and “secure_password” with the password you created for the database user.
For initial setup and troubleshooting, you might want to enable debug mode temporarily:
APP_DEBUG=true
Remember to set this back to “false” after completing the installation for security reasons.
Now, set appropriate permissions for Snipe-IT directories:
# Set proper ownership and permissions
sudo chown -R www-data:www-data /var/www/snipe-it
sudo chmod -R 755 /var/www/snipe-it
These permissions allow the web server to read and write to the necessary files while maintaining security.
Step 6: Web Server Configuration
You can use either Apache or Nginx as your web server. We’ll cover both options:
Option A: Apache Configuration
If you prefer Apache, install and configure it as follows:
# Install Apache
sudo apt install apache2 -y
# Enable required modules
sudo a2enmod rewrite
# Create virtual host configuration
sudo nano /etc/apache2/sites-available/snipe-it.conf
Add the following configuration:
<VirtualHost *:80>
ServerName your_domain_or_ip
DocumentRoot /var/www/snipe-it/public
<Directory /var/www/snipe-it/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/snipe-it_error.log
CustomLog ${APACHE_LOG_DIR}/snipe-it_access.log combined
</VirtualHost>
Enable the site and restart Apache:
# Enable the site
sudo a2ensite snipe-it.conf
# Disable default site (optional)
sudo a2dissite 000-default.conf
# Test configuration
sudo apache2ctl configtest
# Restart Apache
sudo systemctl restart apache2
Option B: Nginx Configuration
If you prefer Nginx, install and configure it this way:
# Install Nginx
sudo apt install nginx -y
# Create server configuration
sudo nano /etc/nginx/sites-available/snipe-it
Add the following configuration:
server {
listen 80;
server_name your_domain_or_ip;
root /var/www/snipe-it/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Enable the site and restart Nginx:
# Create symbolic link to enable site
sudo ln -s /etc/nginx/sites-available/snipe-it /etc/nginx/sites-enabled/
# Test configuration
sudo nginx -t
# Restart Nginx
sudo systemctl restart nginx
Ensure your PHP-FPM service is running:
sudo systemctl start php8.3-fpm
sudo systemctl enable php8.3-fpm
Step 7: Installing Snipe-IT Dependencies
With our web server configured, we need to install Snipe-IT’s PHP dependencies using Composer:
# Navigate to Snipe-IT directory
cd /var/www/snipe-it
# Install dependencies
sudo composer install --no-dev --prefer-dist
This command installs all required PHP libraries and dependencies while excluding development packages to optimize performance. Note that this process may take several minutes depending on your server’s specifications.
Next, generate an application key:
# Generate application key
sudo php artisan key:generate
If you encounter any errors related to PHP 8.3 compatibility, you might need to modify some files or temporarily downgrade to PHP 8.1, which has been reported to work more reliably with Snipe-IT.
Step 8: Accessing and Initializing Snipe-IT
Now that we’ve completed the installation and configuration, it’s time to access and initialize Snipe-IT through the web interface. Open your web browser and navigate to:
http://your_domain_or_ip
You should see the Snipe-IT pre-flight check page, which verifies that all requirements are met. If any issues are detected, the page will provide guidance on how to resolve them.
Click on “Next: Create Database Tables” to proceed with the installation. Snipe-IT will create all necessary database tables and structures.
After the database setup is complete, click on “Next: Create User” to set up an administrator account. Fill in the following information:
- Site name (your organization’s name)
- Admin email address
- Admin first name and last name
- Admin password (strong and secure)
Click on “Next: Save User” to create the administrator account and complete the installation. You’ll be redirected to the Snipe-IT dashboard, where you can begin configuring your asset management system.
Post-Installation Configuration
With Snipe-IT up and running, consider these important post-installation configurations:
Email Settings
Configure email settings to enable notifications:
- Navigate to Admin > Settings > Mail
- Enter your SMTP server details
- Save and test the configuration
Asset Categories and Models
Set up your asset structure:
- Create asset categories (laptops, desktops, monitors, etc.)
- Define manufacturers
- Create asset models with specific details
- Configure custom fields for organization-specific information
User Management
Organize your user structure:
- Create departments and locations
- Set up user groups and permissions
- Add users manually or through LDAP/Active Directory integration
Remember to disable debug mode after completing your configuration by setting APP_DEBUG=false
in the .env
file for improved security.
Security Hardening
To enhance the security of your Snipe-IT installation, implement these additional measures:
- Enable HTTPS: Install a SSL/TLS certificate and configure your web server to use HTTPS instead of HTTP.
- Implement regular backups: Set up automated backups of your database and Snipe-IT files.
- Keep software updated: Regularly update Ubuntu, PHP, MariaDB, and Snipe-IT itself.
- Enhance file permissions: Further restrict access to sensitive files:
sudo find /var/www/snipe-it -type f -exec chmod 644 {} \; sudo find /var/www/snipe-it -type d -exec chmod 755 {} \;
- Consider Ubuntu Security Guide (USG): Ubuntu 24.04 offers advanced hardening automation through Ubuntu Pro subscription with CIS benchmark profiles.
Performance Optimization
For optimal Snipe-IT performance, especially in larger environments:
- Enable caching: Modify
.env
file to use file or Redis caching:CACHE_DRIVER=file
- Optimize PHP: Adjust PHP-FPM settings in
/etc/php/8.3/fpm/pool.d/www.conf
:pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 35
- Database optimization: Add indexes to frequently queried tables and optimize MySQL/MariaDB configuration.
- Web server tuning: Configure proper caching headers and compression settings.
- Consider CPU performance governor: For dedicated servers, consider changing the CPU governor from “ondemand” to “performance” using cpufrequtils for maximum processing power.
Troubleshooting Common Issues
PHP Compatibility Issues
If you encounter errors related to PHP 8.3 compatibility:
- Check the GitHub issue tracker for known issues and solutions
- Consider temporarily downgrading to PHP 8.1 which has better compatibility
- Apply any recommended patches or fixes from the Snipe-IT community
Database Connection Errors
If you see database connection issues:
- Verify database credentials in the
.env
file - Check that MariaDB service is running:
sudo systemctl status mariadb
- Test connection manually:
mysql -u snipeituser -p -h localhost snipeit
Permission Problems
For permission-related errors:
- Reset permissions:
sudo chown -R www-data:www-data /var/www/snipe-it
- Check log files:
/var/log/apache2/error.log
or/var/log/nginx/error.log
- Ensure PHP has write access to storage directories
Web Server Configuration Issues
If the site doesn’t load:
- Verify web server configuration:
sudo apache2ctl configtest
orsudo nginx -t
- Check that the virtual host is enabled
- Confirm that required modules are enabled (rewrite for Apache)
Congratulations! You have successfully installed Snipe-IT. Thanks for using this tutorial for installing the Snipe-IT on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Snipe-IT website.