How to Install Trino SQL: A Complete Step-by-Step Guide
Trino SQL is a powerful distributed SQL query engine designed for running interactive analytic queries against various data sources. Whether you’re a developer, data engineer, or analyst, installing Trino lets you query large datasets efficiently. This tutorial walks you through the installation process on a Linux system, covering prerequisites, configuration, troubleshooting, and a summary checklist to ensure success.
Prerequisites
- A Linux server or VM with a modern distribution (Ubuntu, CentOS, Debian, etc.)
- Java Development Kit (JDK) 11 or higher installed and configured
- Basic familiarity with command-line interface (CLI) and Linux permissions
- Network access for downloading software and dependencies
- Optional: Access to a data source to connect Trino (e.g., Hive, MySQL)
Step 1: Install Java
Trino requires Java 11 or newer. You can install OpenJDK 11 using your package manager. For Ubuntu/Debian:
sudo apt update
sudo apt install openjdk-11-jdk
java -version
Verify that the version output shows Java 11 or newer.
Step 2: Download Trino Server
Download the latest Trino server tarball from the official Trino website (Official site). You can use wget to download it directly:
wget https://repo1.maven.org/maven2/io/trino/trino-server/403/trino-server-403.tar.gz
Step 3: Extract and Set Up Directory
Extract the tarball and move it to a designated directory, such as /opt/trino:
sudo tar -xzf trino-server-403.tar.gz
sudo mv trino-server-403 /opt/trino
sudo chown -R youruser:youruser /opt/trino
Replace youruser with your Linux username to ensure you have write permissions.
Step 4: Configure Trino
Trino configuration lives in the /opt/trino/etc directory. Essential files to configure:
config.properties– main server configurationjvm.config– JVM optionscatalog/– data source connectors configuration
Create or edit config.properties to include:
# HTTP server port
http-server.http.port=8080
# Node identifier
node.id=your-node-unique-id
# Node data directory
node.data-dir=/var/trino/data
Create directories if needed:
sudo mkdir -p /var/trino/data
sudo chown youruser:youruser /var/trino/data
Configure jvm.config with recommended JVM parameters (adjust memory sizes as needed):
-server
-Xmx16G
-XX:+UseG1GC
-XX:+UseStringDeduplication
Step 5: Configure a Catalog
Trino connects to data sources through catalogs. For example, to connect to a MySQL database:
sudo mkdir -p /opt/trino/etc/catalog
cat < /opt/trino/etc/catalog/mysql.properties
connector.name=mysql
connection-url=jdbc:mysql://mysql-host:3306
connection-user=youruser
connection-password=yourpassword
EOF
Replace credentials and host info accordingly.
Step 6: Start Trino Server
Launch Trino using the launcher script:
/opt/trino/bin/launcher start
Check that Trino is running on port 8080 using:
curl http://localhost:8080/v1/info
Troubleshooting Tips
- If Trino fails to start, check logs in
/opt/trino/var/logfor errors. - Ensure Java version is compatible (Java 11+).
- Confirm that the
node.idis unique across cluster nodes. - Verify network connectivity to your data sources (MySQL, Hive, etc.).
- Check file/directory permissions for Trino data directory and config files.
Summary Checklist
- Installed Java 11 or newer
- Downloaded and extracted Trino server
- Configured
config.propertiesandjvm.config - Set up at least one catalog with connection details
- Started Trino server and verified it is running
For more advanced uses and clustering, consider exploring official documentation. You may also find our How to Install Presto SQL tutorial useful, as Presto and Trino share architectural similarities and community roots.
With Trino installed and running, you can efficiently run distributed SQL queries across your data sources, empowering your analytics and data processing workflows.
