---
title: Troubleshoot SQL Server on Linux
description: Troubleshoot SQL Server running on Linux or in a Linux container. Learn where to find information about supported features and known limitations.
author: rwestMSFT
ms.author: randolphwest
ms.date: 11/18/2024
ms.service: sql
ms.subservice: linux
ms.topic: troubleshooting
ms.custom:
- linux-related-content
---
# Troubleshoot SQL Server on Linux
[!INCLUDE [SQL Server - Linux](../includes/applies-to-version/sql-linux.md)]
This article describes how to troubleshoot [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] running on Linux or in a Linux container. When troubleshooting [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] on Linux, remember to review the supported features and known limitations:
- [Release notes for SQL Server 2022 on Linux](sql-server-linux-release-notes-2022.md)
- [Release notes for SQL Server 2019 on Linux](sql-server-linux-release-notes-2019.md)
- [Release notes for SQL Server 2017 on Linux](sql-server-linux-release-notes-2017.md)
For answers to frequently asked questions, see the [SQL Server on Linux FAQ](sql-server-linux-faq.yml).
## Troubleshoot connection failures
If you have difficulty connecting to your Linux [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] instance, there are a few things to check.
- If you're unable to connect locally using `localhost`, try using the IP address 127.0.0.1 instead. It's possible that `localhost` isn't properly mapped to this address.
- Verify that the server name or IP address is reachable from your client machine.
To find the IP address of your Ubuntu machine, you can run the `ifconfig` command as in the following example:
```bash
sudo ifconfig eth0 | grep 'inet addr'
```
For Red Hat, you can use the `ip addr` command as in the following example:
```bash
sudo ip addr show eth0 | grep "inet"
```
> [!TIP]
> One exception to this technique relates to Azure VMs. For Azure VMs, [find the public IP for the VM in the Azure portal](/azure/azure-sql/virtual-machines/linux/sql-vm-create-portal-quickstart#connect).
- If applicable, check that you opened the [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] port (default 1433) on the firewall.
- For Azure VMs, check that you have a [network security group rule for the default SQL Server port](/azure/azure-sql/virtual-machines/linux/sql-vm-create-portal-quickstart#remote).
- Verify that the user name and password don't contain any typos, extra spaces, or incorrect casing.
- Try to explicitly set the protocol and port number with the server name like the following example: `tcp:servername,1433`.
- Network connectivity issues can also cause connection errors and timeouts. After verifying your connection information and network connectivity, try the connection again.
## Manage the SQL Server service
The following section shows how to manage the execution of [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] Linux containers. To manage services for Linux, see [Start, stop, and restart SQL Server services on Linux](sql-server-linux-start-stop-restart-sql-server-services.md).
### Manage the execution of the SQL Server Linux container
You can get the status and container ID of the latest created [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] Linux container by running the following command (The ID is under the `CONTAINER ID` column):
```bash
sudo docker ps -l
```
You can stop or restart the [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] service as needed using the following commands:
```bash
sudo docker stop
sudo docker restart
```
> [!TIP]
> For more troubleshooting tips for Linux containers, see [Troubleshoot SQL Server Docker containers](sql-server-linux-docker-container-troubleshooting.md).
## Access the log files
The [!INCLUDE [ssNoVersion](../includes/ssnoversion-md.md)] [!INCLUDE [ssDE](../includes/ssde-md.md)] logs to the `/var/opt/mssql/log/errorlog` file in both the Linux and container installations. You need to be in **superuser** mode to browse this directory.
The installer logs here: `/var/opt/mssql/setup-