Deploy Open Source Point of Sale
Point of sale and inventory system for small retail shops
MySQL
Just deployed
/var/lib/mysql
opensourcepos
Just deployed
/app/public/uploads
Deploy and Host Open Source Point of Sale on Railway
Open Source Point of Sale (OSPOS) is a browser-based till and inventory system for small retail — a shop counter, a market stall, a café, a club bar. It runs the register, keeps the stock ledger, holds customers and suppliers, issues quotes and invoices, and reports on all of it. It is MIT-licensed PHP on CodeIgniter 4 with MySQL behind it, maintained in the open since 2013. Self-host Open Source Point of Sale when you want a till that belongs to you: no per-terminal subscription, no percentage of takings, and a sales history you can query.
Deploy Open Source Point of Sale on Railway and you get two services. opensourcepos is the application — Apache and mod_php serving the register over your generated public URL, with a volume at /app/public/uploads for product photos. MySQL is Railway's managed MySQL 9.4, private to the project, holding every table the app owns: items, sales, people, sessions and settings. On first boot the container waits for MySQL, runs the migrations, and sets the admin password you supplied before Apache accepts a single request.

Getting Started with Open Source Point of Sale on Railway
Set OSPOS_ADMIN_PASSWORD when you deploy — the container refuses to start without it rather than falling back to the credentials published in upstream's schema. ENCRYPTION_KEY is generated for you and must not change later; the app encrypts stored data with it.
The first deployment takes a few minutes, because the container runs roughly ninety migrations before serving anything. When the URL comes up, sign in as admin with your password.
Start in Items and create a product — barcode, name, category, cost, retail price, the first tax row, an opening quantity and a photo, which is written to the volume and survives redeploys. Add a customer under Customers. Then open Sales, scan the barcode into Find or Scan Item, attach the customer, tender the amount and complete the sale. Check Reports → Detailed → Transactions: the sale appears and the item's stock has fallen by what you sold.
Before taking real money through it, visit Office → Configuration and set your shop name, address, currency, tax rates and receipt layout — the defaults are placeholders. Add an employee account per person who uses the till.



About Hosting Open Source Point of Sale
Commercial point-of-sale software is usually rented: a monthly fee per register, sometimes a slice of card volume, and an export button that hands you a CSV rather than your data. OSPOS is the opposite trade — you own the database in exchange for doing the hosting.
What it gives you:
- A touch-friendly register with barcode scanning, line discounts, split payments and suspended sales
- Stock management for items and kits, with attributes, reorder levels, receivings and suppliers
- Quotes, invoices and receipts, printable or emailed
- Customer records with per-customer discounts, taxable status and spending history
- Gift cards, reward points, expenses and end-of-shift cash-ups
- Multi-user accounts with per-module permissions, and per-location stock
- Reporting across sales, items, customers, employees, payments, taxes and inventory
The architecture is deliberately small: opensourcepos is the whole application, with no worker, queue or cache tier to keep in sync. MySQL stores everything including sessions, which is why a redeploy does not sign anyone out. The volume holds only product images.
Why Deploy Open Source Point of Sale on Railway
Railway removes the server administration this app would otherwise need:
- MySQL 9.4 is provisioned, backed up and private to the project
- The public URL and its TLS certificate are issued automatically
- The volume for product images persists across every deploy
- Migrations and admin setup run on boot — no install wizard to babysit
- Scaling and metrics are a dashboard setting, not a server rebuild
Common Use Cases
- A single-location shop, café or bar that wants a till without a per-terminal subscription
- A market stall or pop-up needing a register on a tablet, with stock shared across days
- A club, school or charity shop where several volunteers each need their own account
- A small wholesaler using receivings and quotes alongside counter sales
Dependencies for Open Source Point of Sale
- opensourcepos — built from gridalpha/opensourcepos-railway, a thin image over
jekkos/opensourcepos:master: Apache with mod_php 8.2. - MySQL — Railway's managed
mysql:9.4, reached over the private network on port 3306.
Environment Variables Reference
| Variable | Purpose |
|---|---|
OSPOS_ADMIN_PASSWORD | Password for the admin account, applied before the app serves traffic |
ENCRYPTION_KEY | At-rest encryption key; must stay the same for the life of the installation |
MYSQL_HOST_NAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DB_NAME | Database connection, wired to the MySQL service |
ALLOWED_HOSTNAMES_EXTRA | Extra hostnames to accept, for a custom domain |
PHP_TIMEZONE | Timezone for receipts, reports and cash-ups |
Deployment Dependencies
- Source: opensourcepos/opensourcepos · image
jekkos/opensourcepos - Docs: the project wiki and
INSTALL.mdin the repository - Runtime: PHP 8.2 with
mysqli,gd,intlandbcmath; MySQL 5.7+ or MariaDB 10.x
Hardware Requirements for Self-Hosting Open Source Point of Sale
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 512 MB app + 512 MB MySQL | 1 GB app + 1 GB MySQL |
| Storage | 1 GB volume + 1 GB database | 5 GB volume + 5 GB database |
| Runtime | PHP 8.2–8.4, MySQL 5.7+ / MariaDB 10.x | PHP 8.2, MySQL 9.4 |
Self-Hosting Open Source Point of Sale
Outside Railway the quickest path is the project's own Compose file, which starts the app and a MySQL container together:
git clone https://github.com/opensourcepos/opensourcepos.git
cd opensourcepos
docker compose up -d
That is upstream's development configuration and ships default passwords, so change them before exposing it. To run the published image against an existing database:
docker run -d -p 8080:80 \
-e CI_ENVIRONMENT=production \
-e ALLOWED_HOSTNAMES=pos.example.com \
-e MYSQL_HOST_NAME=db.example.com \
-e MYSQL_USERNAME=ospos \
-e MYSQL_PASSWORD=change-me \
-e MYSQL_DB_NAME=ospos \
jekkos/opensourcepos:master
A manual install works too: unpack a release build into a PHP 8.2 web root and point .env at an empty MySQL database — the schema is created the first time you open the site. Building from a clone needs the asset build first; see BUILD.md.
Is Open Source Point of Sale Free?
Yes. OSPOS is MIT-licensed and free to use commercially, with no per-terminal fee, no transaction cut and no paid edition held back. There is no vendor to buy support from either — the wiki, the issue tracker and the Gitter room are the support channel. On Railway you pay only for the compute, database and storage it uses.
FAQ
What is Open Source Point of Sale? A web-based point of sale and inventory system written in PHP on CodeIgniter 4, storing its data in MySQL. It covers the register, stock, customers, suppliers, invoicing, expenses, cash-ups and reporting.
What does this Railway template deploy?
Two services: the opensourcepos application with a volume for product images, and a private managed MySQL database. Migrations run on first boot and the admin password comes from the variable you supply, so there is no installer to click through.
Why does the template include a MySQL database? OSPOS keeps everything in MySQL — items, sales, people, permissions, settings and login sessions. Because sessions live there rather than on disk, a redeploy does not sign anyone out.
How do I log in to self-hosted Open Source Point of Sale for the first time?
Sign in as admin with the password you set in OSPOS_ADMIN_PASSWORD. The credentials published in the project's schema are replaced before the app accepts its first request, so the documented default will not work — that is deliberate.
Can I use my own domain with Open Source Point of Sale on Railway?
Yes. Attach the domain in Railway, then add it to ALLOWED_HOSTNAMES_EXTRA — the app validates the Host header against that list when building its own URLs.
How do I back up an Open Source Point of Sale deployment?
Dump the MySQL database and copy the volume at /app/public/uploads. Together they are the whole installation; the container holds no state.
Does self-hosted Open Source Point of Sale work on a tablet at the counter? Yes. The register is usable on a touchscreen, and a USB or Bluetooth barcode scanner acts as a keyboard, so scanning needs no driver.
Template Content
MySQL
mysql:9.4opensourcepos
gridalpha/opensourcepos-railway