You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/en/self-host.md
+2-336Lines changed: 2 additions & 336 deletions
Original file line number
Diff line number
Diff line change
@@ -4,340 +4,6 @@ section: content
4
4
locale: en
5
5
---
6
6
7
-
# Self Host
7
+
# Location Change
8
8
9
-
## Server Requirements
10
-
11
-
<p>Invoice Ninja has a few system requirements. Built on top of <ahref="https://www.laravel.com/docs/">Laravel</a> it requires a PHP and MySQL server at a minimum with the following version and extensions installed.</p>
12
-
13
-
<x-warning>
14
-
You need to setup this version completely from scratch. Do not attempt to overwrite your old version of Invoice Ninja (4.x.x) with this version as the two codebases are completely different.
Community member TechnicallyComputers has a very helpful step by step guide on how to install Invoice Ninja v5 from scratch onto Ubuntu, you can access the guide [here](https://forum.invoiceninja.com/t/install-invoice-ninja-v5-5-on-ubuntu-22-04/13272)
49
-
50
-
### Installing on CentOS 8
51
-
52
-
If CentOS is more your Flavour, community member TechnicallyComputers has a very thorough step by step installation guide [here](https://forum.invoiceninja.com/t/install-invoice-ninja-v5-on-centos-8/4293).
53
-
54
-
### Installing on Arch
55
-
56
-
If Arch Linux is more your flavour, community member brackenhill-mob has a very thorough step by step installation guide [here](https://forum.invoiceninja.com/t/howto-install-invoice-ninja-v5-on-arch-linux/6196)
57
-
58
-
### Installing on Enterprise Linux
59
-
60
-
TechnicallyComputers also has a guide for installation Invoice Ninja on Enterprise Linux [here](https://forum.invoiceninja.com/t/install-invoice-ninja-v5-on-enterprise-linux-8/4293)
61
-
62
-
### Installing using Docker
63
-
64
-
We have a dedicated repository with detailed instructions on how to get started <ahref="https://github.com/invoiceninja/dockerfiles">HERE</a>.
<p>A prebuilt tar can be downloaded from our GitHub release page <ahref="https://github.com/invoiceninja/invoiceninja/releases">here</a>. You will need to download the package named <b>invoiceninja.tar</b></p>
73
-
74
-
<p>Untar this file into the virtual host directory you have created.</p>
75
-
76
-
#### File Permissions
77
-
78
-
<x-warning>
79
-
Ensure the file permission have been set to the web server user. For example in Ubuntu this is www-data if you have configured a virtual host with a root directory of `/var/www/html` you would set the ownership like this.
80
-
</x-warning>
81
-
82
-
```bash
83
-
sudo chown -R www-data:www-data /var/www/html
84
-
sudo find ./ -type d -exec chmod 755 {} \;
85
-
```
86
-
87
-
##### Web server configuration
88
-
<p>A sample NGINX configuration is provided below, it assumes you have PHP 8.1 installed with the PHP FPM extension installed</p>
Enable gzip in your webserver configuration, this will dramatically improve the loading time of the application! Please see the above nginx configuration for a sample of how to load the components of the application with gzip.
132
-
</x-warning>
133
-
134
-
##### Database server configuration
135
-
136
-
<p>Create a database on your MySQL compatible server and add a user that has full access to the database. Database configuration is out of the scope of this article, more information can be found <a href="https://dev.mysql.com/doc/refman/8.0/en/creating-database.html">here</a></p>
137
-
138
-
##### Cron configuration
139
-
140
-
<x-warning>
141
-
Ensure you set the scheduler under the web server user i.e. `sudo -u www-data crontab -e`
142
-
</x-warning>
143
-
144
-
<p>Invoice Ninja relies heavily on the Laravel Scheduler, for this to operate it requires that a cron job to be configured, edit your crontab and enter the following record.</p>
**Note** replace v5.11.53 with the latest tag version, you will also want to ensure that when performing updates, you use the latest tag version rather than a particular branch, ie v5-develop. This will ensure that you are not pulling in work in progress code.
167
-
168
-
169
-
### Final setup steps
170
-
171
-
<p>Once you have configured your virtual host, copy the same .env file </p>
172
-
173
-
174
-
```bash
175
-
.env.example
176
-
177
-
```
178
-
to
179
-
180
-
```bash
181
-
.env
182
-
183
-
```
184
-
<p>
185
-
then create a database and point your browser to http://your.domain.com/setup - the setup process will check a number of system settings such as PDF generation, database and mail settings and also allow you to configure the first account on the system, click Submit and the app will setup your application and redirect you to the login page</p>
186
-
187
-
188
-
#### Cron configuration
189
-
<p>Invoice Ninja relies heavily on the Laravel Scheduler, for this to operate it requires that a cron job to be configured, edit your crontab and enter the following record</p>
190
-
191
-
<x-warning>
192
-
Ensure you set the scheduler under the web server user i.e. `sudo -u www-data crontab -e`
Some Webservers require the Cronjob to end with `> /dev/null 2>&1` instead of `>> /dev/null 2>&1`for it to work.
200
-
Also check if your Webserver Cronjob needs to be set with `/private_html/` instead of `/public_html/` within the path.
201
-
And sometimes it's enough to put `php` instead of `/opt/alt/php73/usr/bin/php` in the cronjob scheduler command to execute.
202
-
203
-
If you still encounter errors, it may be helpful to temporarily remove `>> /dev/null 2>&1` from the cron, this should output the cron to the `cron.log`
204
-
205
-
If you are having troubles with your crons, have a look at the troubleshooting section [here](https://invoiceninja.github.io/en/self-host-troubleshooting/#cron-not-running-queue-not-running)
206
-
207
-
If you would like to improve the performance of your Invoice Ninja installation, then turning on the queue system will dramatically improve the performance of the application.
208
-
209
-
If you have root access to your system, then simply follow the Laravel [guide](https://laravel.com/docs/8.x/queues#supervisor-configuration) to configure the supervisor service to start and restart your queue.
210
-
211
-
You will then need to update the QUEUE_CONNECTION variable in the .env file as follows:
212
-
213
-
```
214
-
QUEUE_CONNECTION=database
215
-
```
216
-
217
-
If you are on shared hosting, it is possible to get the queues working by defining a new cron with the following configuration:
This cron will start a queue worker every 5 minutes and run any jobs that are in the queue and then gracefully terminate itself. This means any emails / notification may be queued for a small period of time prior to executing. If this amount of delay is acceptable, it is a great way to get queue's working on shared hosting.
230
-
231
-
If you prefer to manage the queues with Supervisor, then you will want to disable the internal Invoice Ninja commands which start the queue, to do this simly set the following .env var
232
-
233
-
```
234
-
INTERNAL_QUEUE_ENABLED=false
235
-
```
236
-
237
-
You will then have full control over the queue.
238
-
239
-
240
-
## Shared Hosting
241
-
242
-
#### Server Requirements
243
-
244
-
We have tested Invoice Ninja v5 on shared hosting and can confirm that it does work. Softaculous has a one click installer which makes the entire setup process simple, however if you do not have Softaculous available it may still be possible to install Invoice Ninja. There are several checks you will need to do prior to confirming whether your Shared Host has the correctly enabled modules. Invoice Ninja relies on:
245
-
246
-
* proc_open
247
-
*exec
248
-
* open_basedir
249
-
* fpassthru
250
-
251
-
Without these modules, you will not be able to run Invoice Ninja. We do include some preflight checks of these modules in the Setup workflow, but it is best to check with your host that they support these modules. Some hosts choose to disable these modules as they classify them as security risks.
252
-
253
-
#### Database configuration
254
-
255
-
Create a MySQL compatible database in your shared host control panel along with a database user, record the database name, username and password as you'll need this later. Ensure your database user has full access to the database you've just created.
256
-
257
-
#### Upload release asset
258
-
259
-
Download the latest release from our <a href="https://github.com/invoiceninja/invoiceninja/releases">Releases</a> page. Note, you'll want to find the latest release which will contain 3 files, the one you need will be annotated as invoiceninja.tar.
260
-
261
-
Upload this file to your shared host, typically if your webhost uses the industry standard cPanel, you'll want to upload the **invoiceninja.tar** file to the **public_html** directory. Once the upload has completed, using the file manager untar the file.
262
-
263
-
You will also need to copy/rename the .env.example file to .env
264
-
265
-
#### Run setup
266
-
267
-
Navigate to https://your.url.com/setup and fill in the form. The setup process will perform some pre flight checks and then attempt run the setup. If it has been successful you will be navigated to the Admin portal. If the setup fails forsome reason, you'll be returned to the Setup screen with an error message, there may be additional errors reportedin**storage/logs/laravel.log** that will provide more information where the setup has failed.
268
-
269
-
If you see a **404 webserver error** and use **sub.domain.com** make sure to point the path for the subdomain towards the `/public` folder from the extracted invoiceninja.tar file, for example: ``/domains/domain.com/public_html/invoices2/public/``
270
-
271
-
##### Add the cron job
272
-
273
-
Add the Laravel scheduler cron job, be sure to include the full path, for a cPanel host it should look like this:
When configuring your email, please ensure all of the fields are filled in. In particular you _must_ include the MAIL_FROM_ADDRESS and MAIL_FROM_NAME to prevent errors such as
282
-
283
-
```bash
284
-
Address in mailbox given [ ] does not comply with RFC 2822, 3.6.2.
285
-
```
286
-
287
-
Here is a full example - using Gmail as an example.
NOTE: if you are using SSL encryption the MAIL_PORT is 465. TLS encryption is on port 587.
303
-
</x-warning>
304
-
305
-
### Individual mail configurations per company
306
-
307
-
From v5.5.38 we support per company mail configurations.
308
-
309
-
What does this mean?
310
-
311
-
For example if you have two Companies, Acme co and Ninja co you can create separate mail server configurations for each company.
312
-
313
-
To configure this you will need to prefix your .env with the primary key of the company ie In your database open the companies table, and if the primary ID column is 1 for Acme co this would be the configuration
Currencies are updated automatically by using the scheduler. In case the currencies are not available within the UI please double check the database table `currencies` and ensure that `exchange_rate` fields contains realistic values.
9
+
Content has moved to https://invoiceninja.github.io/en/self-host-installation/
0 commit comments