Skip to content

Gasprinskiy/gammu-mysql-db

Repository files navigation

Gammu MySQL Database

This repository provides a MySQL/MariaDB database schema and Docker setup for Gammu SMSD. It is used to store incoming and outgoing SMS messages when Gammu SMSD is running inside a container or directly on a server.


Features

  • Predefined database schema for Gammu SMSD
  • Ready-to-use Docker Compose setup
  • Configurable via .env file
  • Persists messages (inbox, outbox, sent, failed, etc.) in a MySQL/MariaDB database

Prerequisites

  • Docker and Docker Compose installed
  • Optional: a common Docker network if you also want to containerize the Gammu SMSD service

👉 If you plan to run gammu-smsd in a container, create the network:

./create_sms_services_network.sh

👉 If you plan to run gammu-smsd directly on the host, you can comment out the networks section in the docker-compose.yml.


Setup

  1. Clone this repository:

    git clone https://github.com/Gasprinskiy/gammu-mysql-db.git
    cd gammu-mysql-db
  2. Create a .env file in the root of the project with the following variables:

    DB_ROOT_PASSWORD=your_root_password
    DB_NAME=smsdb
    DB_USER=smsuser
    DB_PASSWORD=yourpassword
  3. Start the database container:

    ./start_docker.sh

    This will run MySQL/MariaDB with the Gammu SMSD schema automatically applied.


Usage

Once the database container is running:

  • Configure your gammu-smsdrc to connect to this database, for example:

    [smsd]
    service = sql
    driver = native_mysql
    host = gammu-mysql-db
    user = smsuser
    password = yourpassword
    database = smsdb
  • Gammu SMSD will then store all incoming/outgoing SMS in this database.

If you also need to run Gammu SMSD in a container, use the companion repository: 📦 gammu-smsd-container


Data Persistence

The database container uses a Docker volume to persist data, so your SMS history will not be lost if the container is restarted.

About

Gammu MySQL Database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages