Skip to main content
This guide walks you through installing and configuring AnimeThemes Server on your local machine or server.

Prerequisites

Before you begin, ensure you have the following installed:

PHP 8.5

Required PHP version with modern features

MySQL 8+

Relational database for data storage

Composer

PHP dependency manager

Web Server

Laravel Herd, Apache, or Nginx
A LAMP stack like XAMPP can provide Apache, MySQL, and PHP together. Alternatively, use Laravel Herd for a simpler setup.

PHP configuration

Before installing, verify your PHP configuration has the required extensions enabled in php.ini:
1

Enable required extensions

Open your php.ini file and ensure these extensions are enabled:
php.ini
extension=fileinfo  ; Needed to detect MIME types during seeding
extension=gd        ; Needed to process image files
extension=pdo_mysql ; Needed for MySQL database connection
extension=intl      ; Needed for internationalization
On Windows, uncomment the lines by removing the ; prefix. On Linux/Mac, these extensions are usually enabled by default.
2

Configure upload limits

To support video uploads, increase the upload size limits:
php.ini
post_max_size = 200M
upload_max_filesize = 200M
After modifying php.ini, restart your web server for changes to take effect.

Installation

1

Clone the repository

Clone the AnimeThemes Server repository from GitHub:
Terminal
git clone [email protected]:AnimeThemes/animethemes-server.git
cd animethemes-server
If you don’t have SSH keys set up with GitHub, use HTTPS instead:
git clone https://github.com/AnimeThemes/animethemes-server.git
2

Create the database

Create a MySQL database for AnimeThemes:
Terminal
mysql -h localhost -u root -p -e "CREATE DATABASE IF NOT EXISTS \`animethemes\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
When prompted, enter your MySQL root password.
The database uses utf8mb4_unicode_ci collation to support international characters and emoji.
3

Install dependencies and set up

Run the automated setup command to install dependencies, configure the environment, and seed the database:
Terminal
composer setup
This command performs the following actions:
  • Installs PHP dependencies via Composer
  • Copies .env.example to .env if it doesn’t exist
  • Generates an application key
  • Runs database migrations
  • Seeds the database with initial data
  • Optimizes the application
The setup process may take several minutes depending on your system and internet connection.
4

Configure environment variables

Open the .env file and configure your environment:
.env
# Application
APP_NAME=AnimeThemes
APP_ENV=local
APP_DEBUG=true
APP_URL=http://animethemes.test

# Database
DB_CONNECTION=mysql_prod
DB_HOST_READ=127.0.0.1
DB_HOST_WRITE=127.0.0.1
DB_PORT=3306
DB_DATABASE=animethemes
DB_USERNAME=root
DB_PASSWORD=your_password_here

# API
API_PATH=/api
API_URL=http://animethemes.test/api

# GraphQL
GRAPHQL_PATH=/graphql
GRAPHQL_URL=http://animethemes.test/graphql
GRAPHIQL_ENABLED=true

# Admin Panel
FILAMENT_PATH=admin
FILAMENT_URL=http://animethemes.test/admin
Never commit your .env file to version control. It contains sensitive credentials.

Web server configuration

Choose your preferred web server setup:
Laravel Herd provides the simplest setup experience:
1

Install Laravel Herd

Download and install Laravel Herd for your operating system.
2

Link the project

In your project directory, run:
Terminal
herd link animethemes.test
This creates a local domain for your application.
3

Access the application

Visit http://animethemes.test in your browser.
Herd automatically serves your application on port 80 and handles PHP execution.

Local storage configuration

By default, AnimeThemes stores media files locally. Configure local storage disks in your .env file:
.env
# Audio storage
AUDIO_DISK_DEFAULT=audios_local
AUDIO_DISKS=audios_local
AUDIO_DISK_ROOT=  # Optional: specify custom directory

# Video storage
VIDEO_DISK_DEFAULT=videos_local
VIDEO_DISKS=videos_local
VIDEO_DISK_ROOT=  # Optional: specify custom directory

# Image storage
IMAGE_DISK=images_local
IMAGE_DISK_ROOT=  # Optional: specify custom directory

# Database dumps
DUMP_DISK=dumps_local
DUMP_DISK_ROOT=  # Optional: specify custom directory

# Scripts
SCRIPT_DISK=scripts_local
SCRIPT_DISK_ROOT=  # Optional: specify custom directory
Create symbolic links to make storage directories accessible:
Terminal
php artisan storage:link
If you store media files in an external directory, set the *_DISK_ROOT variables to the full path. Add a .gitignore file in the media directory to prevent Git from indexing large files.

Create an admin user

To access the admin panel, create a user with admin privileges:
1

Open Laravel Tinker

Terminal
php artisan tinker
2

Create the user

Tinker
$user = User::factory()->create([
    'name' => 'Admin User',
    'email' => '[email protected]',
    'password' => 'password',
    'email_verified_at' => now()
]);
3

Assign admin role

Tinker
$user->assignRole('Admin');
The Admin role grants full permissions to all resources and actions.
4

Exit Tinker

Press Ctrl+C or type exit to leave Tinker.
You can now log in to the admin panel at http://animethemes.test/admin with your credentials.

Optional: Elasticsearch setup

For advanced search capabilities, configure Elasticsearch:
1

Install Elasticsearch

Follow the Elasticsearch installation guide for your platform.
2

Configure connection

Update your .env file:
.env
SCOUT_DRIVER=elastic
ELASTIC_HOST=http://localhost:9200
ELASTIC_CONNECTION=default
3

Run migrations

Create Elasticsearch indices:
Terminal
php artisan elastic:migrate
4

Import models

Seed the indices with existing data:
Terminal
php artisan db:seed --class="Database\Seeders\Scout\ImportModelsSeeder"
This process may take several minutes for large datasets.

Verification

Verify your installation is working correctly:
Visit http://animethemes.test in your browser. You should see the AnimeThemes homepage.
Make a request to the API:
Terminal
curl http://animethemes.test/api/anime
You should receive a JSON response with anime data.
Visit http://animethemes.test/graphql to access GraphiQL, the GraphQL IDE.Try this query:
{
  anime(first: 5) {
    data {
      name
      year
    }
  }
}
Visit http://animethemes.test/admin and log in with your admin credentials.You should be able to access the resource management interface.

Troubleshooting

Check the Laravel logs:
Terminal
tail -f storage/logs/laravel.log
Common causes:
  • Missing .env file: Run cp .env.example .env
  • Missing application key: Run php artisan key:generate
  • Incorrect file permissions: Run chmod -R 775 storage bootstrap/cache
Verify your database credentials in .env:
  • Check DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD
  • Ensure MySQL is running: sudo systemctl status mysql
  • Test the connection: php artisan db:show
If Composer fails to install dependencies:
  • Update Composer: composer self-update
  • Clear Composer cache: composer clear-cache
  • Install with verbose output: composer install -vvv
Ensure the web server has write permissions:
Terminal
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache
Replace www-data with your web server user if different.

Next steps

Feature flags

Enable or disable features like video streaming and search

Environment configuration

Learn about all available environment variables

Admin panel

Explore the Filament admin interface

Contributing

Contribute to AnimeThemes Server development

Build docs developers (and LLMs) love