AlmaLinuxRHEL Based

How To Install Microsoft SQL Server on AlmaLinux 10

Install Microsoft SQL Server on AlmaLinux 10

Microsoft SQL Server’s expansion to Linux platforms has revolutionized enterprise database management, offering organizations unprecedented flexibility in their infrastructure choices. AlmaLinux 10, as a robust enterprise-grade Linux distribution, provides an ideal foundation for running SQL Server workloads with enhanced stability and security features.

The integration of SQL Server on Linux eliminates traditional platform limitations while maintaining full compatibility with existing Microsoft database technologies. Organizations can now leverage cost-effective Linux environments without sacrificing the powerful features and performance characteristics that make SQL Server a leading database management system. This comprehensive guide walks you through every step of installing Microsoft SQL Server on AlmaLinux 10, from initial system preparation through final configuration and optimization.

Whether you’re migrating from Windows-based SQL Server deployments or implementing a new Linux-first database strategy, this tutorial provides the detailed instructions and troubleshooting guidance necessary for a successful installation. You’ll learn essential prerequisites, security considerations, and best practices that ensure optimal performance and reliability in production environments.

Prerequisites and System Requirements

Hardware Requirements

SQL Server on AlmaLinux 10 demands specific hardware specifications to ensure optimal performance and stability. Your system must include a minimum of 4 GB RAM, though 8 GB or more is strongly recommended for production environments to handle concurrent connections and complex queries effectively. The processor requirements specify a 64-bit architecture with at least 2.0 GHz clock speed, where faster processors significantly improve query execution times and overall system responsiveness.

Storage considerations are equally critical, requiring a minimum of 20 GB free disk space for the basic installation. However, actual storage needs vary dramatically based on database size, transaction log requirements, and backup strategies. Network connectivity should provide stable, low-latency connections to support client applications and administrative tasks. Consider implementing redundant network interfaces for mission-critical deployments to ensure continuous availability.

Software Prerequisites

AlmaLinux 10 must be installed with the latest updates and security patches applied before beginning the SQL Server installation process. Administrative privileges through sudo or root access are essential for package installation, service configuration, and system-level modifications. Verify that your user account has appropriate permissions to execute privileged commands and modify system configuration files.

Essential system libraries and dependencies include glibc, libgcc, libstdc++, krb5-libs, and openssl packages. These components provide critical functionality for SQL Server’s core operations, security implementations, and network communications. Internet connectivity is required during installation to access Microsoft’s package repositories and download necessary components. For offline installations, pre-download all required packages and their dependencies to ensure seamless deployment in isolated environments.

The system’s hostname must not exceed 15 characters to prevent SQL Server service startup issues. This limitation stems from SQL Server’s internal hostname handling mechanisms and can cause service failures if not properly configured. Verify hostname length using the hostnamectl command and modify if necessary before proceeding with installation.

System Preparation and Environment Setup

Updating System Packages

Begin your SQL Server installation by ensuring all system packages are current with the latest security updates and bug fixes. Execute the following command to update your AlmaLinux 10 system comprehensively:

sudo dnf update -y

This command downloads and installs all available updates, including kernel modules, system libraries, and security patches. Outdated packages can create compatibility issues during SQL Server installation, particularly with shared libraries and system dependencies. Monitor the update process for any error messages or package conflicts that require resolution before continuing.

After completing system updates, reboot the server if kernel updates were installed to ensure all changes take effect properly. System stability depends on running the most current kernel version with all associated drivers and security enhancements active.

Installing Essential Dependencies

SQL Server requires several core system libraries to function correctly on AlmaLinux 10. Install these essential dependencies using the following command:

sudo dnf install -y glibc libgcc libstdc++ krb5-libs openssl curl wget gnupg2

These packages provide fundamental functionality including standard C library functions, GNU Compiler Collection runtime libraries, Kerberos authentication support, and SSL/TLS encryption capabilities. The curl and wget utilities enable repository access and package downloads, while gnupg2 provides cryptographic verification for package integrity.

Additional development tools may be required depending on your specific SQL Server configuration and intended usage. Consider installing unixODBC-devel and libnuma-devel packages if you plan to use advanced connectivity options or NUMA-aware memory management features.

SELinux Configuration

Security-Enhanced Linux (SELinux) policies can interfere with SQL Server operations if not properly configured. AlmaLinux 10 ships with SELinux enabled by default, providing enhanced security through mandatory access controls. However, these restrictions may prevent SQL Server from accessing necessary system resources or network ports.

Check your current SELinux status using:

sestatus

For initial installations and troubleshooting, consider setting SELinux to permissive mode temporarily:

sudo setenforce 0

This configuration change allows SQL Server to operate while logging policy violations for analysis. Once installation is complete and SQL Server is running properly, review SELinux logs to identify required policy modifications for production environments.

Microsoft Repository Configuration

Adding Microsoft GPG Key

Microsoft packages require cryptographic verification to ensure authenticity and integrity during installation. Import Microsoft’s official GPG signing key using the following command:

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

This key validates package signatures during the installation process, preventing unauthorized or corrupted packages from being installed on your system. The GPG key serves as a trust anchor for all Microsoft packages, including SQL Server components and associated tools.

Repository Setup

Configure access to Microsoft’s SQL Server repositories for AlmaLinux by adding the appropriate repository definitions. Create the repository configuration file with the following commands:

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2022.repo

This repository provides access to SQL Server 2022 packages optimized for RHEL 8-compatible distributions like AlmaLinux 10. The repository configuration includes package metadata, security signatures, and dependency information necessary for proper installation.

Verify the repository configuration by examining the created file:

cat /etc/yum.repos.d/mssql-server.repo

The repository file should contain valid URLs, GPG key references, and enabled status indicators. Multiple repository versions are available for different SQL Server releases, allowing you to specify particular versions or feature sets based on your requirements.

SQL Server Installation Process

Installing SQL Server Core Package

Execute the primary SQL Server installation using the DNF package manager. This process downloads and installs the core database engine components:

sudo dnf install -y mssql-server

The installation process automatically resolves dependencies and downloads approximately 200-300 MB of packages depending on your system configuration. Monitor the installation output for any error messages related to missing dependencies or package conflicts. Successful installation creates the SQL Server service, installs binaries in /opt/mssql/, and establishes necessary system users and groups.

Package installation includes the database engine, core system stored procedures, configuration utilities, and basic administrative tools. However, client connectivity tools and advanced management utilities require separate installation steps to provide complete functionality.

Verify successful package installation using:

rpm -qi mssql-server

This command displays detailed package information including version, architecture, installation date, and package contents.

Installing SQL Server Command-Line Tools

SQL Server command-line tools provide essential functionality for database administration, query execution, and bulk data operations. Install these tools using:

sudo dnf install -y mssql-tools unixODBC-devel

During installation, you’ll be prompted to accept license agreements for both the SQL Server tools and the ODBC driver components. Type “YES” to accept each license agreement and continue with the installation process. These tools include sqlcmd for interactive query execution, bcp for bulk copy operations, and ODBC drivers for application connectivity.

The unixODBC-devel package provides development headers and libraries necessary for building applications that connect to SQL Server through ODBC interfaces. This component is essential for many third-party applications and programming language drivers.

Offline Installation Alternative

For systems without internet access, SQL Server supports offline installation using pre-downloaded packages. Download the required RPM packages from Microsoft’s repository using a connected system:

  1. Visit https://packages.microsoft.com and locate the appropriate packages for your SQL Server version
  2. Download mssql-server and mssql-tools packages along with their dependencies
  3. Transfer packages to your target system using scp or removable media
  4. Install packages locally using: sudo yum localinstall mssql-server_*.rpm

Offline installation requires careful dependency management to ensure all required components are available. Use rpm -qpR package_name.rpm to list package dependencies and verify all requirements are met before installation.

Initial Configuration and Setup

Running SQL Server Configuration

After successful package installation, configure SQL Server using the mssql-conf utility. This interactive setup process establishes essential settings:

sudo /opt/mssql/bin/mssql-conf setup

The configuration wizard guides you through several critical decisions. First, select your SQL Server edition from available options including Developer (free for development use), Express (free with limitations), Evaluation (full features for 180 days), or licensed editions for production use. Each edition provides different feature sets and usage restrictions appropriate for various deployment scenarios.

Next, establish a strong password for the ‘sa’ (system administrator) account. This account has full administrative privileges and serves as the primary administrative interface for initial database setup. Password requirements include minimum eight characters with complexity requirements encompassing uppercase letters, lowercase letters, numbers, and special characters. Consider using a password manager to generate and store secure credentials.

The configuration process also establishes basic network settings, default file locations, and service startup parameters. Review each option carefully as these settings significantly impact SQL Server’s behavior and security posture.

Service Management

Enable and start the SQL Server service to ensure automatic startup after system reboots:

sudo systemctl enable mssql-server
sudo systemctl start mssql-server

Verify service status to confirm successful startup:

systemctl status mssql-server

The service status should display “active (running)” with recent startup timestamps. Monitor system logs for any startup errors or warnings that might indicate configuration issues or resource constraints.

Configure service dependencies if your deployment requires specific startup ordering with other services like network storage, directory services, or monitoring systems.

Environment Path Configuration

Add SQL Server tools to the system PATH for convenient command-line access:

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

This configuration enables direct execution of sqlcmd, bcp, and other SQL Server utilities without specifying full path names. Apply this configuration to all user accounts that will interact with SQL Server directly.

Security Configuration

Firewall Configuration

Configure AlmaLinux 10’s firewall to allow SQL Server network connections. The default SQL Server port is TCP 1433, which must be accessible for client connections:

sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload

These commands create a permanent firewall rule allowing inbound connections on port 1433 and immediately activate the new configuration. For enhanced security, consider restricting access to specific source IP addresses or network ranges using the --source parameter.

Verify firewall configuration using:

sudo firewall-cmd --list-ports

Additional ports may be required for SQL Server Agent (typically 1434 UDP for discovery) or custom applications that use non-standard connection ports.

Network Security

Configure network access controls to limit SQL Server connectivity to authorized systems and users. SQL Server supports various authentication methods including SQL Server authentication, Windows authentication (through domain integration), and certificate-based authentication.

For production environments, disable or rename the ‘sa’ account after creating alternative administrative accounts with appropriate privileges. Implement network segmentation to isolate database servers from general network traffic and potential security threats.

Password Security

Enforce strong password policies through SQL Server configuration settings and regular password rotation procedures. Default password policies require minimum eight-character length with mixed case letters, numbers, and symbols. Consider implementing more restrictive policies for high-security environments including longer minimum lengths and additional complexity requirements.

Testing and Verification

Service Status Verification

Confirm SQL Server is running properly by checking service status and examining system logs. Use the following command to verify service health:

systemctl status mssql-server --no-pager -l

This command provides detailed status information including process IDs, memory usage, and recent log entries. Active services should display “active (running)” status with stable process identifiers and minimal error messages.

Connection Testing

Test database connectivity using the sqlcmd utility to ensure proper installation and configuration:

sqlcmd -S localhost -U sa -P 'YourPassword'

Successful connections display the SQL Server command prompt (1>). Execute basic queries to verify database functionality:

SELECT @@VERSION;
GO

This query returns SQL Server version information, confirming successful installation and basic query processing capabilities.

Version and Installation Verification

Verify installation completeness by examining package information and SQL Server version details:

rpm -qi mssql-server

This command displays comprehensive package information including version numbers, installation dates, and file locations.

Troubleshooting Common Issues

Installation Problems

Common installation issues include missing dependencies, repository access problems, and package conflicts. Resolve missing dependencies by installing required packages manually or using automatic dependency resolution:

sudo dnf install -f

Repository access issues often stem from network connectivity problems or incorrect repository URLs. Verify internet connectivity and repository configuration files in /etc/yum.repos.d/.

Service and Connection Issues

SQL Server service startup failures typically result from configuration errors, insufficient resources, or permission problems. Examine system logs for detailed error messages:

sudo journalctl -u mssql-server --no-pager

Connection problems often involve firewall restrictions, network configuration issues, or authentication failures. Verify firewall rules, network connectivity, and user credentials systematically to identify root causes.

Best Practices and Optimization

Performance Optimization

Optimize SQL Server performance by configuring appropriate memory settings, storage layouts, and network parameters. Consider dedicating 75-80% of system RAM to SQL Server for optimal performance while reserving sufficient memory for operating system functions.

Implement proper storage configuration using separate drives for data files, transaction logs, and tempdb to minimize I/O contention and improve overall performance.

Security Best Practices

Implement comprehensive security measures including regular security updates, access control reviews, and backup verification procedures. Establish monitoring systems to detect unauthorized access attempts and performance anomalies.

Configure automated backup strategies with offsite storage options to ensure data protection and disaster recovery capabilities. Regular security assessments help identify vulnerabilities and maintain robust security postures.

Congratulations! You have successfully installed Microsoft SQL. Thanks for using this tutorial for installing the Microsoft SQL Server on your AlmaLinux OS 10 system. For additional or useful information, we recommend you check the official Microsoft website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button