# Run SolidInvoice - Open Source Invoicing Software - in Docker

## What is SolidInvoice?

> SolidInvoice is a sophisticated open-source invoicing application designed to assist small businesses and freelancers in efficiently managing their daily billing operations. With its comprehensive range of features, this elegant online platform ensures that you receive timely payments. -https://github.com/SolidInvoice/SolidInvoice

## Installing Docker

1. Log into the Linux based device
2. Run the following commands in the terminal
   # install prerequisites
   sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
   # add docker gpg key
   curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
   # add docker software repository
   sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
   # install docker
   sudo apt install docker-ce docker-compose containerd.io -y
   # enable and start docker service
   sudo systemctl enable docker && sudo systemctl start docker
   # add the current user to the docker group
   sudo usermod -aG docker $USER
   # reauthenticate for the new group membership to take effect
   su - $USER

## Running SolidInvoice

1. Now that Docker is installed, run the following commands to setup the SolidInvoice Docker container and run it
   # create working directories
   mkdir ~/docker/mariadb -p
   # set owner of working directories
   sudo chown "$USER":"$USER" ~/docker -R
   # run the mariadb docker container
   docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=r00tp@ss -e MYSQL_USER=solidinvoice_rw -e MYSQL_PASSWORD=SolidInv0ic3! -e MYSQL_DATABASE=solidinvoice -v ~/docker/mariadb:/var/lib/mysql --restart=unless-stopped mariadb:latest
   # run the solidinvoice docker container
   docker run -d --name solidinvoice --link mariadb:solidinvoice -e DB_PASSWORD=SolidInv0ic3! -e DB_USER=solidinvoice_rw -p 8080:80 --restart=unless-stopped solidinvoice/solidinvoice
2. Open a web browser and navigate to http://DNSorIP:8080
3. Click the Next button at the lower right corner of the System Requirements page
4. Complete the Database settings as follows:

   Driver: Mysql
   Host: mariadb
   Port: 3306
   User: solidinvoice_rw
   Password: SolidInv0ic3!
   Database Name: solidinvoice

5. Click Next
6. After the database schema is created successfully > Click Next
7. Click the Log In Now button
8. Login with the admin credentials created earlier
9. Enter a Company Name and select the default currency > Click Create
10. Welcome to SolidInvoice

Documentation: https://hub.docker.com/r/solidinvoice/solidinvoice/