In this guide, I’m going to show you a quick and easy way to install SnipeIT in Docker in 2021, then this simple step by step guide is for you.

SnipeIT, for those of you who don’t know, is an open source asset and license management tool. It’s great for tracking physical assets like laptops, desktops, and software licenses.

For reference, I am installing this on a Ubuntu 20.04 VM, which already has docker installed. If you don’t have docker or Docker installed yet, you can follow Docker Setup Guide.


Create Folders

Use Putty to SSH into your docker host. I like to start out by putting my containers into the same directory, so I’m first going to create a parent SnipeIT folder.

All of my containers typically go into /srv/config, so that’s where I’ll be creating it.

First, navigate to the config folder:

cd /srv/config

Then, create the folder by entering sudo mkdir snipeit

Next, go into the snipeit directory:

cd snipeit

Then, create two new directories

sudo mkdir snipe-mysql
sudo mkdir snipe-conf


Create MySQL Container

To create the mysql database container, just run the code below. You can change the ROOT and MYSQL passwords, if you’d like to. Also, make sure the timezone is set to your correct location.

docker run \
--name snipe-mysql \
-d \
-e MYSQL_ROOT_PASSWORD="Goldpumpkineagle4" \
-e MYSQL_DATABASE=snipe \
-e MYSQL_USER=snipe \
-e MYSQL_PASSWORD="Wolfhungrysunset8" \
-e TZ=America/Chicago \
-p 127.0.0.1:3306:3306 \
-v /srv/config/snipeit/snipe-mysql:/var/lib/mysql \
mysql:5.6 --sql-mode=""


Create SnipeIT Container

Now, you can create the main SnipeIT container.

docker create \
--name=snipe-it \
--link snipe-mysql:db \
-e PUID=1000 \
-e PGID=1000 \
-e DB_CONNECTION=mysql \
-e DB_HOST=snipe-mysql \
-e DB_DATABASE=snipe \
-e DB_USERNAME=snipe \
-e DB_PASSWORD="Wolfhungrysunset8" \
-e APP_KEY=base64:5U/KPKw1GN/Rz0fWYO/4FsSOqjmjvDAQzMCqwcAqstc= \
-p 8082:80 \
-v /srv/config/snipeit/snipe-conf:/config \
--restart unless-stopped \
snipe/snipe-it

Keep in mind – the DB_PASSWORD will use the MYSQL_PASSWORD in the first container you created.


Launch SnipeIT

Now that both containers are created, you can enter this command to run it. Once complete, SnipeIT should open in a web browser at port 8082.

docker start snipe-it

If all goes well, you should be able to browse to the IP of your docker host (172.16.0.41:8092) in a web browser and you’ll be met with a SnipeIT Pre-Flight screen like this:

Wrapping Up

That’s it! You can run your own instance of open source asset management software in a docker container. I’ve been using SnipeIT (hosted) at my company for the past 5 years, and it’s one of my favorite pieces of software to use. We primarily use it for license management, but in the past (before PDQ Inventory), we used to use it for asset management as well. There are some really neat features for consumable objects too, such as toner, paper, SSD’s, etc.

Similar Posts

12 Comments

  1. Hi, very nice and helpful description, thank you! My only problem is, that at the step, where I should create the Snipe-IT container, I get an error message with “Unable to find image ‘snipe:latest’ “, what in my mind is ok, since the correct image is “snipe/snipe-it:latest”. I tried to change the DB_DATABASE line to snipe/snipe-it (what shouldn’t be right, since it belongs to the MySQL data?) and received a long line of characters and numbers. After that I launched with “docker start snipe-it” and received “Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: “-e”: executable file not found in $PATH: unknown
    Error: failed to start containers: snipe-it” I’ve also installed Portainer.io, where I couldn’t find any container with snipe-it. So I was wondering, where in the lines is the information hidden regards “snipe:latest” so I can change it? Grateful for a response, best regards: Edi

    1. What usually happens when Docker can’t find the image is that it downloads the latest version automatically. Have you tried manually downloading it? Try this: sudo docker pull snipe/snipe-it

      Then, run the script exactly as my script in the guide once it’s downloaded (changing ports & usernames/passwords, if you want).

  2. I got this error when trying to start container.
    Error response from daemon: Cannot link to a non running container: /snipe-mysql AS /snipe-it/db
    Error: failed to start containers: snipe-it

    1. Do you have another Snipe-IT container created, but not running? Possibly from testing? The easiest way to fix this is by creating a new SnipeIT container and giving it a new name

  3. All goes well but when i open the browser it only shows blank screen with a snipe-it logo on address bar.

    1. It doesn’t sound like it completed the install correctly. Maybe check the logs to ensure everything is running?

  4. I also got the blank screen with address bar. But it was due to php being too old. I had to add a php repository and pull down php 7.14 for it to work, otherwise it just came with php 5.4 and that wont work.

    1. * forgot to add, I was doing this on a CentOS 7 box.

      1. Awesome, thanks for the tip!

  5. Hmm, Nice guide, very educational since ive never used Docker before at all.. Thanks.

    i Can get through the entire installation without any errors, can see that Docker is installed and Snipe IT is started. But going to the IP to access it (on my network, 192.168.4.230:8092) i just get “unable to connect”, any idea what could be wrong there?

  6. Great guide. very educational. I can go through these steps and can see Docker is installed correctly and Snipe IT is active.. however i think the IP address of that docker instance (172.something) is not accessible on my network, is it possible to change / specify an IP during installation?

  7. I got invalid reference format when create snipeit container.Any way to fix that?

Leave a Reply

Your email address will not be published. Required fields are marked *