Guided installation¶
Our install script guides you through a series of prompts to install Mathesar. The script sets up Mathesar using Docker Compose under the hood.
Limitations
This is a convenient way to install Mathesar. However, it’s highly opinionated and requires sudo
privileges (admin access), and only supports a limited set of configuration options. Use the Docker Compose installation option if you’d like to customize your installation.
Prerequisites¶
Operating System¶
You can install Mathesar using this method on Linux, MacOS, and Windows.
Access¶
You should have root access to the machine you’re installing Mathesar on.
Software¶
You’ll need to install the following software before you install Mathesar:
- Docker v23+
- Docker Compose v2.10+
- If you’re installing on Windows:
- Ensure you have WSL installed
- Turn on Docker Desktop WSL 2, see Docker docs for more information
Domain (optional)¶
If you want Mathesar to be accessible over the internet, you’ll probably want to set up a domain or sub-domain to use. If you don’t need a domain, you can skip this section.
Before you start installation, ensure that the DNS for your sub-domain or domain is pointing to the machine that you’re installing Mathesar on.
Database (optional)¶
You can create a new PostgreSQL database while setting up Mathesar or use our UI to interact with an existing database. If you don’t have a database you want to connect to, you can skip this section.
To connect Mathesar to an existing database:
- The external database should be able to accept network connections from your Mathesar server.
- You’ll need to set up a database user for Mathesar to use. The user should be a
SUPERUSER
, see PostgreSQL docs for more information. - Have the following information handy before installation:
- Database hostname
- Database port
- Database name
- Database username
- Database password
See Connect to an existing database for more details.
Overview¶
The installation script will set up:
- A Postgres database server to store data
- A web server to run the Mathesar application
- A reverse proxy server to serve static files and set up SSL certificates
- An upgrade server to handle upgrading Mathesar via the web interface
If you’d like to know the steps performed by the install script in more detail, you can read our Guided installation: under the hood document.
Step-by-step guide¶
Getting help
If you run into any problems during installation, see our troubleshooting guide or open a ticket describing your problem.
-
Paste this command into your terminal to begin installing the latest version of Mathesar:
-
Follow the interactive prompts to configure your Mathesar installation.
-
When finished, the installer will display the URL where you can run Mathesar from your web browser.
Connecting to additional databases
Once you have successfully installed Mathesar, if you wish to connect an additional database to Mathesar, instructions are here.
Starting and stopping Mathesar¶
The Mathesar server needs to be running for you to use Mathesar. If you restart your machine, you’ll need to start the server again.
-
Start Mathesar:
-
Stop Mathesar:
This stops all Mathesar Docker containers and releases their ports.
Note
If you customized the Mathesar configuration directory during installation, you’ll need to change /etc/mathesar
to your configuration directory.
Upgrading Mathesar¶
Upgrade from within Mathesar
You can also run the upgrade from within Mathesar by logging in as an admin user and navigating to “Administration” (in the top right menu) > “Software Update”
Manually upgrade Mathesar to the newest version using Watchtower:
Manually upgrade Mathesar to the newest version without using Watchtower:
Uninstalling Mathesar¶
-
Remove all Mathesar Docker images and containers.
-
Remove configuration files.
Note
If you customized the Mathesar configuration directory during installation, you’ll need to change
/etc/mathesar
to your configuration directory. -
Remove Mathesar internal schemas.
If you’d like to continue using your PostgreSQL database, you’ll need to remove the schemas created for Mathesar’s use during installation. You can remove them from the database as follows:
-
Connect to the database.
-
Delete the types schema.
Deleting this schema will also delete any database objects that depend on it. This should not be an issue if you don’t have any data using Mathesar’s custom data types.
-
Delete the function schemas.
-