How to Install Presto SQL: A Step-by-Step Tutorial
Presto SQL is a fast, distributed SQL query engine designed for running interactive analytic queries against various data sources of all sizes. It excels in querying big data where traditional databases struggle with performance. This tutorial guides you through the entire process of installing Presto SQL on a Linux system, configuring it, and ensuring it is ready for querying your data.
Prerequisites
- A Linux server or virtual machine (Ubuntu, CentOS, or similar) with sudo privileges.
- Java Development Kit (JDK) 11 or newer installed because Presto runs on the Java Virtual Machine.
- Basic command line and text editor knowledge.
- Network connectivity if you plan on running Presto in a cluster setup.
- Enough free RAM and CPU resources (at least 4GB RAM recommended for single node testing).
Step 1: Install Java
Presto SQL requires Java 11 or above. To install OpenJDK 11 on Ubuntu, run:
sudo apt update
sudo apt install openjdk-11-jdk
java -version
Verify the Java version output displays version 11 or above.
Step 2: Download Presto Server
Download the latest Presto Server tarball from the official Presto SQL website (Official site). You can use wget or curl. For example:
wget https://repo1.maven.org/maven2/io/prestosql/presto-server/your-version-here/presto-server-your-version.tar.gz
Step 3: Extract and Prepare Presto
Create a directory for Presto and extract the archive:
sudo mkdir /usr/local/presto
sudo tar -xzf presto-server-your-version.tar.gz -C /usr/local/presto --strip-components=1
Step 4: Create Necessary Directories
Presto requires certain directories for configuration and data:
sudo mkdir /etc/presto
sudo mkdir /var/presto/data
Step 5: Configure Presto
Navigate to the configuration directory and create key config files:
cd /etc/presto
- jvm.config – JVM options. Example:
-server
-Xmx16G
-XX:+UseG1GC
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
- config.properties – Main Presto config. Example for single-node:
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=5GB
query.max-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://localhost:8080
- node.properties – Node info. Example:
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/var/presto/data
- catalog directory – place connectors here (e.g., Hive, MySQL). For example, create
hive.propertiesto connect with Hive:
connector.name=hive
hive.metastore.uri=thrift://localhost:9083
Step 6: Run Presto Server
To start Presto, go to the presto installation directory and run the launcher:
cd /usr/local/presto
bin/launcher start
Check logs in the var/presto/data directory if startup issues occur.
Step 7: Verify Installation
Run the Presto CLI to test queries. Download the Presto CLI jar from the official site or use the one bundled with Presto:
wget https://repo1.maven.org/maven2/io/prestosql/presto-cli/current/presto-cli-current-executable.jar
mv presto-cli-current-executable.jar presto
chmod +x presto
./presto --server localhost:8080 --catalog hive --schema default
Try a basic query:
select * from your_table limit 10;
Troubleshooting
- Ensure the configured ports are not blocked by firewall or used by other applications.
- Check Java version and memory settings; insufficient memory can prevent Presto from starting.
- Inspect logs in
/var/presto/datafor errors. - Validate connectivity to any external data source like Hive Metastore or others used by Presto.
Summary Checklist
- Install Java 11 or newer.
- Download and extract Presto Server.
- Create configuration and data directories.
- Configure JVM, node, and catalog settings.
- Start Presto server with launcher.
- Connect with Presto CLI and run a test query.
- Troubleshoot using logs and environment checks if required.
For more advanced insights on configuring cloud Big Data query tools, refer to our guide on <a href="/
