Skip to main content
This guide covers the installation process for FacturaScripts. You can install it on various environments including local development, shared hosting, or dedicated servers.
This repository contains the development version of FacturaScripts. For production use, download the stable release from facturascripts.com/descargar.

Prerequisites

Before installing, ensure your system meets the system requirements:
  • PHP 8.0 or higher
  • MySQL 5.7+ / MariaDB 10.2+ or PostgreSQL 9.5+
  • Composer
  • Node.js & npm (for assets compilation)
  • Web server (Apache, Nginx, or PHP built-in)

Installation Methods

Clone the Repository

# Clone the repository
git clone https://github.com/NeoRazorX/facturascripts.git
cd facturascripts

Install Dependencies

# Install PHP dependencies
composer install

# Install JavaScript dependencies
npm install

Create Configuration File

Create a config.php file in the root directory:
<?php
// Database configuration
define('FS_DB_TYPE', 'mysql'); // or 'postgresql'
define('FS_DB_HOST', 'localhost');
define('FS_DB_PORT', '3306'); // 5432 for PostgreSQL
define('FS_DB_NAME', 'facturascripts');
define('FS_DB_USER', 'your_database_user');
define('FS_DB_PASS', 'your_database_password');

// Timezone
define('FS_TIMEZONE', 'Europe/Madrid');

// Debugging (disable in production)
define('FS_DEBUG', true);

Set Permissions

# Make directories writable
chmod -R 755 .
chmod -R 777 MyFiles

Database Setup

Create Database

CREATE DATABASE facturascripts CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fs_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON facturascripts.* TO 'fs_user'@'localhost';
FLUSH PRIVILEGES;

Web Server Configuration

The easiest way to run FacturaScripts for development:
# Start the development server
php -S localhost:8000 index.php
Or use the Composer script:
composer dev-server
Access the application at http://localhost:8000
The PHP built-in server is not suitable for production use. Use Apache or Nginx for production deployments.

Initial Setup

1

Access the Setup Wizard

Open your browser and navigate to your FacturaScripts installation:
  • Development: http://localhost:8000
  • Production: http://yourdomain.com
You’ll be redirected to the setup wizard.
2

Create Admin Account

The setup wizard will prompt you to create an administrator account:
  • Username: Choose a secure username (not “admin”)
  • Password: Use a strong password (8+ characters, letters + numbers)
  • Email: Your email address for notifications
3

Configure Company

Enter your company details:
  • Company name
  • Tax ID / VAT number
  • Address and contact information
  • Default currency
4

Set Up Accounting

Configure accounting preferences:
  • Fiscal year start date
  • Chart of accounts (country-specific templates available)
  • Tax rates and VAT configuration
  • Payment methods
5

Complete Setup

Review your configuration and click Complete Setup.FacturaScripts will:
  • Create the database schema
  • Import the chart of accounts
  • Set up default data
  • Create your admin user
The initial setup may take 30-60 seconds depending on your server performance.

Post-Installation

Verify Installation

After setup completes, you should:
  1. ✅ Log in with your admin credentials
  2. ✅ Access the Dashboard
  3. ✅ Check that the database connection is working
  4. ✅ Verify file permissions (MyFiles directory should be writable)
For production environments, update your config.php:
// Disable debugging
define('FS_DEBUG', false);

// Set secure cookie settings
define('FS_COOKIES_HTTPONLY', true);
define('FS_COOKIES_SECURE', true); // Only if using HTTPS

// Limit login attempts
define('FS_MAX_LOGIN_ATTEMPTS', 5);
Improve performance:
// Enable caching
define('FS_CACHE_ENABLED', true);
define('FS_CACHE_LIFETIME', 3600);

// Use FastCGI
define('FS_FASTCGI', true);
Configure email for notifications:
  1. Go to Admin PanelSettingsEmail Configuration
  2. Enter your SMTP settings
  3. Test the email configuration

Install Plugins

Extend FacturaScripts with plugins:
  1. Go to Admin PanelPlugins
  2. Browse available plugins
  3. Click Install on desired plugins
  4. Enable the plugin after installation
See the Plugin Management guide for more details.

Troubleshooting

If you see database connection errors:
  • Verify database credentials in config.php
  • Ensure the database exists and is accessible
  • Check that the database user has proper permissions
  • Verify FS_DB_TYPE matches your database server (mysql or postgresql)
If you encounter permission errors:
# Set correct permissions
chmod -R 755 .
chmod -R 777 MyFiles

# Ensure web server user owns the files
sudo chown -R www-data:www-data .
If you see a blank page or 500 error:
  • Enable error display in config.php: define('FS_DEBUG', true);
  • Check PHP error logs
  • Verify all PHP extensions are installed (see System Requirements)
  • Ensure PHP memory limit is at least 128MB
If CSS/JS files are not loading:
# Run npm install to compile assets
npm install
npm run build

Next Steps

Quick Start

Create your first invoice

User Guides

Learn how to use FacturaScripts

Configuration

Configure system settings

Support

Get help from the community