Install from source
This page installs Chatvia from its Git repository on your own computer. The app runs with your own PHP and Node.js, and PostgreSQL and Redis run on your machine too. It is the way to go when you want to read or change the code, contribute, or run Chatvia without containers.
Just want to run it?
The one-liner installs a ready-made Docker setup in a few minutes, with every service included. See Run with Docker. For a server that other people use, we recommend a VPS (a virtual private server that you control): see Where to install.
Requirements
Install these on your computer before you start.
Software
PHP 8.5.12 or newer With the extensions
dom,fileinfo,intl,libxml,openssl,pdo,pdo_pgsql,redis,sodium,mbstring,curl,zip,gd,exifandpcntl.Composer 2 Installs the PHP packages, Laravel Horizon included.
Node.js 22.18 or newer, with npm Builds the frontend and the chat widget. The widget's build runs TypeScript files directly.
Git Gets the code, and downloads the chat widget when it is built.
Install the software on macOS
Laravel Herd installs PHP, Composer and Node.js in one app, with every extension Chatvia needs. With Homebrew instead:
brew install php composer node@22 gitCheck the versions with php -v, composer -V and node -v. Homebrew's
php formula already has the extensions above, except redis:
pecl install redisInstall the software on Ubuntu or Debian
PHP 8.5 comes from the ondrej/php
package archive, and Node.js 22 from NodeSource. Not from Ubuntu's own
nodejs and npm packages: Ubuntu builds Node.js without TypeScript
support, and the chat widget's build runs TypeScript files directly.
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install git unzip php8.5-cli php8.5-pgsql php8.5-redis php8.5-intl \
php8.5-mbstring php8.5-curl php8.5-zip php8.5-gd php8.5-xml
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -
sudo apt install nodejs
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composernode -p process.features.typescript prints strip when Node.js runs
TypeScript files. If it prints false, remove Ubuntu's with
sudo apt remove nodejs npm and install NodeSource's again.
On Windows
Use WSL 2 with Ubuntu, and follow the Ubuntu steps inside it. Keep the code in
the Linux file system (for example ~/code/chatvia), not under /mnt/c, or
the app will be slow.
Services
For now, Chatvia needs Redis and Laravel Horizon, also on your own computer. See Redis and Horizon are required. Step 2 installs the services.
PostgreSQL 17 or 18 Holds everything Chatvia stores. It needs the pgvector extension (
vector) for search by meaning. pg_textsearch gives the best keyword search, but you can skip it.Redis 7 or newer Queues, cache, sessions, rate limits, locks and the live chat history.
Laravel Horizon Runs the queue workers that read documents, send replies on messaging channels and run analytics. It comes with Chatvia: you only start it (step 7).
Mailpit Optional Catches every e-mail on your computer: sign-up confirmations, invitations and sign-in links. Without it, set
MAIL_MAILER=logto write e-mails to the log.
Programs for some file types
All of them are optional. Without one, Chatvia does the work itself, or turns away only the files it cannot read.
poppler (
pdfinfo,pdftotext) PDF files: counts their pages and finds locked ones.pandoc EPUB books and Word (
.docx) files.catdoc (
catdoc,catppt) A backup for old Word (.doc) and PowerPoint (.ppt) files.ffmpeg (
ffmpeg,ffprobe) Makes audio and video small enough for speech to text. Without it, only recordings the speech-to-text service takes as they are can be uploaded (such as an MP3 under 25 MB).WeasyPrint (
weasyprint) Exports a chat as PDF, and makes summaries of office files. Without it, pick another PDF maker in the admin panel, under Settings → Platform → PDF maker.
# macOS
brew install poppler pandoc catdoc ffmpeg weasyprint
# Ubuntu and Debian
sudo apt install poppler-utils pandoc catdoc ffmpeg weasyprintPowerPoint (.pptx) and Excel (.xlsx) files need no extra program. If a
program is not on the PATH of the web server or the queue workers (for
example Homebrew's /opt/homebrew/bin on a Mac), enter its full path in the
admin panel, under Settings → Platform → Programs.
An AI provider
One chat provider and one embedding provider The embedding provider turns text into search vectors. With the default settings, one Scaleway API key covers both. You enter it in step 8.
1. Get the code
git clone https://github.com/chatvia/chatvia.git
cd chatviaEvery command below runs in this folder.
2. Set up PostgreSQL and Redis
-
Install PostgreSQL with pgvector, Redis and Mailpit, and start them:
bash# macOS brew install postgresql@18 pgvector redis mailpit brew services start postgresql@18 brew services start redis brew services start mailpit # Ubuntu and Debian sudo apt install postgresql-18 postgresql-18-pgvector redis-serverOn Ubuntu, install Mailpit with the steps on its website, or skip it and set
MAIL_MAILER=login step 4. -
Create a role and the five databases:
chatviafor the app,testingfor the tests,analyticsfor the numbers behind the charts and reports, andpulseandspectra, where Pulse (/pulse) and Spectra (/spectra) keep their data. The first migration runsCREATE EXTENSION, so the role needs the right to do that. On your own computer, a superuser is simplest. Openpsql(on macOS withpsql postgres, on Ubuntu withsudo -u postgres psql) and run:sqlCREATE ROLE chatvia LOGIN SUPERUSER PASSWORD 'password'; CREATE DATABASE chatvia OWNER chatvia; CREATE DATABASE testing OWNER chatvia; CREATE DATABASE analytics OWNER chatvia; CREATE DATABASE pulse OWNER chatvia; CREATE DATABASE spectra OWNER chatvia; -
Optional: install pg_textsearch from its releases page, load it in
postgresql.confand restart PostgreSQL:inishared_preload_libraries = 'pg_textsearch'Without it, keyword search uses PostgreSQL's built-in full-text search (see The database).
-
Optional: install pg_partman (on Ubuntu, the
postgresql-18-partmanpackage). It splits the analytics event log into one table per month, so old months are removed in one step. Without it, the log stays one table and old rows are deleted in batches.
PostgreSQL listens on 127.0.0.1:5432, Redis on 127.0.0.1:6379, and
Mailpit on 127.0.0.1:1025, with its inbox at http://localhost:8025. These
are the addresses .env.example expects.
Rather run these services in Docker?
The repository has a docker-compose.yml that starts PostgreSQL (with both
search extensions), Redis and Mailpit, and creates the four databases. The
app itself keeps running on your computer.
docker compose up -d
docker compose psWait until all three services show healthy. If a port is taken, choose
another one with FORWARD_DB_PORT, FORWARD_REDIS_PORT,
FORWARD_MAILPIT_PORT or FORWARD_MAILPIT_DASHBOARD_PORT (for example
FORWARD_DB_PORT=5433 docker compose up -d), and set the same port in
.env. docker compose down stops the services and keeps the data.
docker compose down -v deletes it.
3. Install the packages
composer install
npm cicomposer install stops with a clear message when a PHP extension is
missing. Install it and run the command again.
4. Create the .env file
cp .env.example .env
php artisan key:generate.env.example has a short comment on every setting, and its defaults already
match the services from step 2:
APP_URL=http://localhost:8000
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=chatvia
DB_USERNAME=chatvia
DB_PASSWORD=password
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
QUEUE_CONNECTION=redis
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025Two secrets have no value yet. Fill them in with random strings:
# Signs the calls to the built-in tools (charts, forms, weather, ...). They stop working while it is empty.
BUILTIN_MCP_SECRET=
# Signs the live updates from Reverb.
REVERB_APP_SECRET=openssl rand -hex 32Decide on the embedding storage now
EMBEDDING_VECTOR_TYPE and EMBEDDING_DIMENSIONS can only be set before step
5 creates the tables. The defaults suit almost every install. See
Embedding storage.
API keys for outside services are not in .env. You enter them in the admin
panel in step 8, where they are stored encrypted.
5. Create the database tables
php artisan chatvia:deploy:migrate
php artisan storage:linkchatvia:deploy:migrate checks that the analytics, Pulse and Spectra
databases are there, and creates any that are missing. Then it creates the
tables, checks the embedding settings and adds the built-in tools. On a new
install the built-in tools only show a warning: they need the API key you
enter in step 8. The first migration installs the PostgreSQL extensions. If
it fails with
extension "vector" is not available, pgvector is not installed in this
PostgreSQL (step 2), or DB_HOST and DB_PORT point at another server.
The AI models that agents can pick from are added in the admin panel's setup, in step 8.
Demo data
On a computer that is not in production, php artisan db:seed loads a
starter list of AI models and creates a demo admin account
([email protected] / password, set with SEED_ADMIN_EMAIL and
SEED_ADMIN_PASSWORD), three agents and sample chats and analytics. It is
handy for a look around. Skip it for anything real. The admin setup still
opens on your first visit to the admin panel.
6. Create your admin account
php artisan chatvia:admin:create-user [email protected] "Your Name"The command asks for a password, so it does not end up in your shell history. The account is an admin with its own workspace and team.
7. Start the app
composer devThis starts four processes in one terminal:
| Process | Command | What it does |
|---|---|---|
| Web server | php artisan serve |
Serves the app at http://localhost:8000 |
| Queue worker | php artisan queue:listen |
Runs jobs from the default queue |
| Logs | php artisan pail |
Shows the log as it is written |
| Vite | npm run dev |
Builds the frontend, and reloads the page when you change it |
Two more processes need their own terminal:
# Reads documents, sends channel replies and exports: jobs on every queue, not only "default".
php artisan horizon
# Live updates in the browser, such as the progress of a document being read.
php artisan reverb:startAnd two more when you need them, each in its own terminal too:
# Scheduled cleanup, statistics and backups.
php artisan schedule:work
# The CPU, memory and disk on the Servers card at /pulse.
php artisan pulse:checkSources stuck on "Pending"?
Documents are read by queued jobs on several named queues. When a source does
not move past Pending, Horizon is not running. Start php artisan horizon.
If you use Herd or Valet, they serve the app at
http://chatvia.test instead of php artisan serve. Set APP_URL to that
address.
8. Add your API keys
-
Open the admin panel at http://localhost:8000/admin and sign in with the account from step 6.
-
The admin panel opens with the setup of a new install. Choose your AI provider and enter its API key, pick the chat and embedding models, and click Finish setup. You can change it all later under Settings → AI providers and Settings → AI models.
-
Finishing the setup adds Chatvia's built-in tools (charts, forms, weather, currency, web search) to the tool catalog. If you skipped the setup, add them after you entered the key, as they use your embedding provider:
bashphp artisan chatvia:mcp:sync-builtin
Settings can also be read and changed from the command line:
php artisan chatvia:settings:list lists them and php artisan chatvia:settings:set sets one.
Check that it works
- Open http://localhost:8000, sign in, and create an agent from Dashboard → Agents → Create agent.
- Add a source, for example a short PDF or a text snippet. Its status moves from Pending to Processing to Ingested.
- Ask a question in the agent's Playground. The answer streams in. Open the chat in Chatlog to see the parts of your sources it used.
- Open Mailpit at http://localhost:8025 to see the e-mails Chatvia sent.
Update
git pull
composer install
npm ci
php artisan chatvia:deploy:migrateThen restart composer dev, Horizon, Reverb and pulse:check (when it
runs), so they run the new code.
Run the tests
The tests use the testing database from step 2:
composer testTroubleshooting
| Problem | What to do |
|---|---|
could not find driver |
The pdo_pgsql extension is missing. Install it (on Ubuntu: php8.5-pgsql). |
database "pulse" does not exist (or "analytics", "spectra") |
Run php artisan chatvia:db:create-tool-databases, then migrate again. |
Connection refused for Redis or PostgreSQL |
The services are not running. Start them (on macOS: brew services start postgresql@18 and brew services start redis; on Ubuntu: sudo systemctl start postgresql redis-server). |
Address already in use |
Another program uses the port. Serve the app on another port with php artisan serve --port=8001 and change APP_URL. |
Unable to locate file in Vite manifest |
Vite is not running. Start composer dev, or build once with npm run build. |
| A source fails with "program not found" | Install the program for that file type, or enter its path under Settings → Platform → Programs (see Programs for some file types). Then restart Horizon. |
| No live progress | Reverb is not running, or REVERB_HOST and REVERB_PORT do not match where it runs. Start php artisan reverb:start, and rebuild with npm run dev. |
| Built-in tools answer with an error | BUILTIN_MCP_SECRET is empty. Set it, then run php artisan config:clear. |