Skip to main content

Installation

LibreDTE Core is distributed via Composer and requires PHP 8.5 or higher.

Requirements

Before installing, ensure your system meets these requirements:
1

PHP Version

PHP 8.5 or higher is required
php -v
2

Required Extensions

Verify the following PHP extensions are installed:
  • ext-curl: HTTP communication with SII
  • ext-json: JSON data handling
  • ext-mbstring: Multibyte string processing
  • ext-openssl: Digital signatures and encryption
  • ext-soap: SOAP webservice client for SII
php -m | grep -E "curl|json|mbstring|openssl|soap"
3

Composer

Composer is required for dependency management
composer --version
If not installed, get it from getcomposer.org

Install via Composer

composer require libredte/libredte-lib-core
LibreDTE Core has minimum-stability: dev with prefer-stable: true. This allows installation of development dependencies while preferring stable versions when available.

Verify Installation

After installation, verify LibreDTE Core is properly installed:
<?php

require 'vendor/autoload.php';

use libredte\lib\Core\Application;

// Create application instance
$app = Application::getInstance('prod', false);

echo "LibreDTE Core installed successfully!\n";

Dependencies

LibreDTE Core automatically installs these key dependencies:

Symfony Components

  • symfony/cache: Caching support
  • symfony/filesystem: File operations
  • symfony/mailer: Email functionality
  • symfony/mime: MIME type handling

Document Processing

  • mpdf/mpdf: PDF generation
  • tecnickcom/tcpdf: Alternative PDF library
  • league/csv: CSV processing
  • phpseclib/phpseclib: Cryptography

Environment Configuration

LibreDTE Core supports different environments:
<?php

use libredte\lib\Core\Application;

// Development environment with debug enabled
$app = Application::getInstance('dev', true);

Global Helper Function

LibreDTE Core provides a global helper function for convenient access:
<?php

require 'vendor/autoload.php';

// Load the bootstrap file
require 'vendor/libredte/libredte-lib-core/app/bootstrap.php';

// Use the global helper function
$app = libredte_lib('prod', false);

// Access services
$billingPackage = $app->getService('libredte.lib.billing');
The singleton pattern via getInstance() is provided for convenience but is not recommended when using dependency injection. In DI environments, inject the Application instance from your container instead.

Next Steps

Now that LibreDTE Core is installed:

Quick Start

Create your first electronic invoice

Core Concepts

Understand the architecture and components

Troubleshooting

LibreDTE Core requires PHP 8.5+. If you see version errors:
# Check your PHP version
php -v

# Update PHP or use a different version
composer config platform.php 8.5
Install required extensions based on your system:
# Debian/Ubuntu
sudo apt install php8.5-curl php8.5-mbstring php8.5-soap php8.5-xml

# macOS with Homebrew
brew install [email protected]
If Composer runs out of memory during installation:
COMPOSER_MEMORY_LIMIT=-1 composer require libredte/libredte-lib-core

Build docs developers (and LLMs) love