apt install php8.1-{bcmath,cli,curl,gd,mbstring,mysql,opcache,readline,xml,zip} libapache2-mod-php8.1 mariadb-server unzip
Download the latest version of Crater from here.
wget https://craterapp.com/downloads/file/6.0.6 -O crater.zip
Unzip the archive and move it to /var/www/
unzip crater.zip
mv crater /var/www/
Change file ownership and permissions
chmod 755 -R /var/www/crater
chown www-data:www-data -R /var/www/crater
Run the secure installation script (change the root password, answer Yes to all prompts)
mysql_secure_installation
Login with root
mysql
Create a new database
CREATE DATABASE crater;
Create a new db user
CREATE USER 'crater'@'localhost' IDENTIFIED BY '******';
Grant all privileges on the new database to the new user
GRANT ALL PRIVILEGES ON crater.* TO 'crater'@'localhost';
Create a new site config - /etc/apache2/sites-available/crater.conf
. Paste the following command to create the file
bash -c "cat > /etc/apache2/sites-available/crater.conf" <<'EOF'
<VirtualHost *:80>
ServerName crater.example.com
DocumentRoot /var/www/crater/public
<Directory /var/www/crater/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/crater_error.log
CustomLog /var/log/apache2/crater_access.log combined
</VirtualHost>
EOF
Enable the new vhost config, disable the default vhost
a2ensite crater.conf
a2dissite 000-default.conf
Enable the rewrite
mod
a2enmod rewrite
Restart Apache
systemctl restart apache2.service
Setup a cron job that will run the Crater scheduler to send out Recurring Invoices
bash -c "cat > /etc/cron.d/crater" <<'EOF'
* * * * * www-data /usr/bin/php /var/www/crater/artisan schedule:run >> /dev/null 2>&1
EOF
Restart cron.service
systemctl restart cron.service
Navigate to the web interface and walk through the installation wizard.