Snipe-IT is an open-source IT asset management system that runs on a LAMP/LEMP stack. Below are the steps to install Snipe-IT on Ubuntu (22.04 or later).
Step 1: Update and Install Dependencies
bashsudo apt update && sudo apt upgrade -y
sudo apt install -y apache2 mariadb-server php php-cli php-mbstring php-xml php-bcmath php-curl php-zip php-tokenizer unzip git curl
Step 2: Configure MySQL
- Secure MySQL installation: bashCopyEdit
sudo mysql_secure_installation
- Set a root password
- Remove anonymous users
- Disallow remote root login
- Remove the test database
- Login to MySQL and create a database for Snipe-IT: bashCopyEdit
sudo mysql -u root -p
Then run the following SQL commands: sqlCopyEditCREATE DATABASE snipeit; CREATE USER 'snipeituser'@'localhost' IDENTIFIED BY 'StrongPassword'; GRANT ALL PRIVILEGES ON snipeit.* TO 'snipeituser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Step 3: Install Composer and Clone Snipe-IT
bashsudo apt install -y composer
cd /var/www
sudo git clone https://github.com/snipe/snipe-it.git
sudo chown -R www-data:www-data snipe-it
cd snipe-it
cp .env.example .env
Edit .env
to configure database settings:
bashnano .env
Modify these lines:
iniAPP_URL=http://your-server-ip
DB_DATABASE=snipeit
DB_USERNAME=snipeituser
DB_PASSWORD=StrongPassword
Save and exit.
Step 4: Install PHP Dependencies
bashcomposer install --no-dev --prefer-source
Step 5: Configure Apache
Create an Apache Virtual Host:
bashsudo nano /etc/apache2/sites-available/snipeit.conf
Paste the following:
pgsql<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/snipe-it/public
ServerName your-server-ip
<Directory /var/www/snipe-it/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/snipeit_error.log
CustomLog ${APACHE_LOG_DIR}/snipeit_access.log combined
</VirtualHost>
Enable the site and restart Apache:
bashsudo a2enmod rewrite
sudo a2ensite snipeit.conf
sudo systemctl restart apache2
Step 6: Run Snipe-IT Migrations
bashphp artisan migrate --force
php artisan key:generate
Step 7: Configure Permissions
bashsudo chown -R www-data:www-data /var/www/snipe-it
sudo chmod -R 755 /var/www/snipe-it/storage
sudo chmod -R 755 /var/www/snipe-it/bootstrap/cache
Step 8: Access Snipe-IT
Open your browser and go to:
arduinohttp://your-server-ip
Complete the setup wizard.
Step 9: (Optional) Enable HTTPS with Let’s Encrypt
bashsudo apt install -y certbot python3-certbot-apache
sudo certbot --apache -d your-domain.com