Hi Recently installed invoiceninja via snap what is the next step to get it going i am on a headless server on ubuntu 20 thanks
After installing Invoice Ninja billing software via Snap, follow these steps to get it running on your headless Ubuntu 20 server:
-
Set up MySQL Database:
- Ensure MySQL is installed:
sudo apt-get update sudo apt-get install mysql-server
- Secure your MySQL installation:
sudo mysql_secure_installation
- Log into MySQL:
sudo mysql -u root -p
- Create a new database and user for Invoice Ninja:
CREATE DATABASE invoiceninja; CREATE USER 'ninjauser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON invoiceninja.* TO 'ninjauser'@'localhost'; FLUSH PRIVILEGES; EXIT;
- Ensure MySQL is installed:
-
Configure Invoice Ninja:
- Navigate to the Invoice Ninja directory (check where Snap installed it, usually
/var/snap/invoice-ninja/current/
):cd /var/snap/invoice-ninja/current/
- Copy the environment configuration file:
cp .env.example .env
- Edit the
.env
file to configure database connection and other settings:
Update the following lines with your database information:nano .env
DB_HOST=127.0.0.1 DB_DATABASE=invoiceninja DB_USERNAME=ninjauser DB_PASSWORD=password
- Navigate to the Invoice Ninja directory (check where Snap installed it, usually
-
Set Up Cron Job:
- Invoice Ninja requires a cron job to handle recurring tasks:
sudo crontab -e
- Add the following line to run the cron job every minute:
* * * * * /usr/bin/php /var/snap/invoice-ninja/current/artisan schedule:run >> /dev/null 2>&1
- Invoice Ninja requires a cron job to handle recurring tasks:
-
Start Invoice Ninja:
- Start the Invoice Ninja service:
sudo systemctl start snap.invoice-ninja.daemon
- Enable the service to start on boot:
sudo systemctl enable snap.invoice-ninja.daemon
- Start the Invoice Ninja service:
-
Access Invoice Ninja:
- Open your browser and navigate to your server’s IP address or domain name. The setup wizard should guide you through the final steps.
By following these steps, you’ll have Invoice Ninja up and running on your Ubuntu 20 headless server.