In this post, we'll learn How to Install Microsoft SQL Server on Ubuntu VPS Server. and we will see how to connect and manage it remotely using SQL Server Management Studio on windows.
Let's Get a VPS Server
In this tutorial, I will use VULTR, and if you wanna follow with me a test, you can use this link to get 100$ free credits for two weeks!
- Select Cloud compute.
- Select any region you want.
- Select Ubuntu as the OS.
- Enter server name (anything you want)
- Click deploy
VULTR will install, deploy, and prepare this Ubuntu Linux server in your account. And when it's finished, you will see the IP address, the username, and the password.
Great! we have an Ubuntu Server β Let's Start the installation.
we will be using putty SSH client to connect and manage our server.
Open putty, enter the server IP, and connect:
Enter "root" as the user name, and get the password from Vultr Dashboard.
Install SQL Server
The first command is wget command:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Adding SQL server package
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
NOTE: This may change depending on the Ubuntu version you are working with.
Update SQL Server
sudo apt-get update
sudo apt-get install -y mssql-server
*Configuration command *
sudo /opt/mssql/bin/mssqql-conf setup
Now Continue the wizard:
- Select your edition, I will go with express.
- Accept Terms (Y)
Set The SQL Server Password
And Congratulations! SQL Server is now starting π
SQL Server Run Check Command:
systemctl status mssql-server --no-pager
And it's running perfectly.πππ
Managing With SQL Server Management Studio
Setting up SQL Server Remote Port
in putty, run this command:
Sudo iptables -A INPUT -p tcp βdport 1433 -j ACCEPT
Now we can connect to SQL server from our local PC.
Open SQL Management Studio, Enter your server IP.
Enter "sa" for the user name, and enter your sql server password that you chose in the setup.
Connect!
Yay, it did work!!!π
I'll be answering questions in the comments below if you have any.
Top comments (0)