SlideShare a Scribd company logo
Deploy .Net application and SQL
server database on linux
environment
Ajith Ramawickrama
Chief Technology Officer
FinTechnology Asia Pasific.
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core application and sql server database on Linux
Introduction
Microsoft has been working with Linux for a number of years in order
to facilitate their customers to run work loads in both Windows and
Linux platforms. Followings are the few achievements
Linux on your Datacenter – Hyper-V
Linux on Azure
.Net Core
Visual Studio Code – Official IDE for .Net core on Linux and OSX
SQL Server V-Next (Production release on mid 2017)
.Net Core
.Net Core is a cross platform, open source, general purpose , modular
application development framework developed by Microsoft. Unlike
other .Net framework, .Net core has built from the stretch using .Net
standards. It contains most of APIs as the .Net standard framework, but
.net core is a smaller set which includes runtime, framework, compiler
and tools components that support a variety of operating systems and
chip targets. .Net runs on Windows, Linux and OS-x operating systems.
.Net Core
Advantages of .Net core
Flexible deployment: Can be included in your app or installed side-by-side user- or
machine-wide.
Cross-platform: Runs on Windows, macOS and Linux
Command-line tools: All product scenarios can be exercised at the command-line.
Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET
Standard.
Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses.
 Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support
Runs on Docker.
Comes with inbuilt web server Kerstral
Supporting Linux Systems
Ubuntu – 14.04,16.04,16.10
Red Hat Enterprise Linux
Linux Mint -17,18
Debian 8
Fedora
CentOS 7.1
Oracle Linux 7.1
Open SUSE
Install .Net core on Ubuntu 16.04 LTS
1) Preparing the system for installation
In order to apt-get feed that hosts the package you need Run following commands in the
console one after another
• sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" >
/etc/apt/sources.list.d/dotnetdev.list'
• sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
• sudo apt-get update
2) Install .Net Code SDK
Run Following command in order to install .Net Core SDK
sudo apt-get install dotnet-dev-1.0.4
Deploy FinAp Formula in Ubuntu 16.04
There are two types of deployment options available in .Net core
1) Framework dependent deployment
 .Net core should be pre installed
 Size of the deployment package is very small
 Reduce the disk and memory usage of deployment server
2) Self contained deployment
 Create deployment package including all framework dependencies and other third party
dependencies
 No need to install .Net core on target server
 Need to set target platform at the time of deployment package creation
 Large deployment package
Framework dependent deployment
 Go to your solution folder in windows command prompt
 Run the command “dotnet restore” in order to make sure that all the dependencies are properly
restored
 Navigate to ASP.Net application(web or web api) folder and run the command “dotnet build” to
build the solution
 Run the command “dotnet publish -f netcoreapp1.1 -c Release” to create deployment package
 Copy created package to Ubuntu PC
 Go to the copied directory and run “dotnet executable-name.dll” in ubuntu terminal
SQL Server VNext
• SQL Server 2017 represents a major step towards making SQL Server
a platform that gives you choices of development languages, data
types, on-premises and in the cloud, and across operating systems by
bringing the power of SQL Server to Linux, Linux-based Docker
containers, and Windows.
• Newest version is SQL Server 2017 CTP 2.1. According to Microsoft
Production version to be released on mid 2017
• Currently Support Linux Versions
• Red Hat Enterprise Linux
• SUSE Linux Enterprise Server
• Ubuntu 16.04
• Docker Engine 1.8 +
Install SQL Server Vnext on Ubuntu 16.04
• Minimum System Requirements
• Memory- 3.25 GB
• File System- XFS or EXT4
• Disk Space - 1GB
• Processor Speed -1.4 Ghz
• Processor Cores – 2 cores
• Processor Type – X64 only
1) Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
2) Register the Microsoft SQL Server Ubuntu repository:
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee
/etc/apt/sources.list.d/mssql-server.list
3) Install SQL Server
sudo apt-get update
sudo apt-get install -y mssql-server
4) Config SQL Server
sudo /opt/mssql/bin/mssql-conf setup
5) Check the status
systemctl status mssql-server
Install SQL tools on Ubuntu
1) Import the public repository GPG keys.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –
Register the Microsoft Ubuntu repository.
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee
/etc/apt/sources.list.d/msprod.list
3) unixODBC developer package
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
4) Update MsSql tools
sudo apt-get update
sudo apt-get install mssql-tools
5) Set PATH variable
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
Restore SQL Server Backup On Ubuntu
• Take a backup of the database from Windows machine
• Transfer backup to Linux (VMWare Tools/PUTTY,SSH)
• Move the backup files to SQL directory
Enter Super user mode
sudo su
Create Backup Directory On /var/opt/mssql
mkdir -p /var/opt/mssql/backup
Move Backup files
mv /home/user1/AdventureWorks2014.bak
/var/opt/mssql/backup/
• Restore database
sqlcmd -S localhost -U SA
RESTORE DATABASE FinApCore
FROM DISK = '/var/opt/mssql/backup/backupName.bak'
WITH MOVE ‘FinApCore_Data' TO '/var/opt/mssql/data/FinapCore_Data.mdf',
MOVE ‘FinApCore_Log' TO '/var/opt/mssql/data/FinApCore_Log.ldf'
GO
Why we Need Reverse Proxy?
• Kestrel is the default web server for .net core which is serving
dynamic contents
• Reverse Proxy Allows Us to
• serving static content
• caching requests
• compressing requests
• SSL termination from the HTTP server
• IIS Works as the reverse proxy for windows and NginX or Apache
works as the reverse proxy for Linux
Thank You

More Related Content

PDF
Code Factory avec GitLab CI et Rancher
PPTX
Open stack implementation
PDF
L'affaire CentOS
PDF
How to integrate_custom_openstack_services_with_devstack
ODP
OpenStack DevStack Configuration localrc local.conf Tutorial
PDF
How to master OpenStack in 2 hours
PPT
Features supported by squid proxy server
PDF
Nelf2012
Code Factory avec GitLab CI et Rancher
Open stack implementation
L'affaire CentOS
How to integrate_custom_openstack_services_with_devstack
OpenStack DevStack Configuration localrc local.conf Tutorial
How to master OpenStack in 2 hours
Features supported by squid proxy server
Nelf2012

What's hot (20)

DOCX
final proposal-Xen based Hypervisor in a Box
PDF
Dev stacklabguide
PPTX
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
PPTX
DataDrivenMtl 20170906 - SQL Server 2017 on Linux
PDF
PDF
Scale13
PDF
Oracle linux kube
PDF
Introduction to FreeNAS development by John Hixson
PDF
PPTX
Helm @ Orchestructure
PPTX
Devops in Networking
PDF
Rancher Rodeo
ODP
LinuxKit Swarm Nodes
PDF
Docker security: Rolling out Trust in your container
PDF
Docker Security and Content Trust
PDF
Olf2017
PPTX
K8s security best practices
PPTX
Docker Container Security - A Network View
PPTX
DevStack
PPTX
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
final proposal-Xen based Hypervisor in a Box
Dev stacklabguide
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
DataDrivenMtl 20170906 - SQL Server 2017 on Linux
Scale13
Oracle linux kube
Introduction to FreeNAS development by John Hixson
Helm @ Orchestructure
Devops in Networking
Rancher Rodeo
LinuxKit Swarm Nodes
Docker security: Rolling out Trust in your container
Docker Security and Content Trust
Olf2017
K8s security best practices
Docker Container Security - A Network View
DevStack
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
Ad

Similar to Install .Net Core, SQL Server V-Next on Linux and deploy .Net core application and sql server database on Linux (20)

PDF
Pottnet MeetUp Essen - ASP.Net Core
PDF
Pottnet Meetup Essen - ASP.Net Core
PDF
Docker-v3.pdf
PDF
Docker Multi-arch All The Things
PDF
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
PPTX
WSO2Con USA 2015: Revolutionizing WSO2 PaaS with Kubernetes & App Factory
PDF
Linux on Hyper-V
PPTX
NET core 2 e i fratelli
PPTX
What should you know about Net Core?
PPTX
Docker - Demo on PHP Application deployment
PPTX
Geek Sync I Working with SQL Server for Linux Cross-Platform
PDF
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
PDF
OpenShift 4 installation
PDF
OpenShift_Installation_Deep_Dive_Robert_Bohne.pdf
PDF
Kubernetes for the PHP developer
PPTX
Fluo CICD OpenStack Summit
PDF
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
PPT
Visual studio 2015 and .net core 5 – get ready to rumble
PDF
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
PPTX
ASP.NET vNext
Pottnet MeetUp Essen - ASP.Net Core
Pottnet Meetup Essen - ASP.Net Core
Docker-v3.pdf
Docker Multi-arch All The Things
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
WSO2Con USA 2015: Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Linux on Hyper-V
NET core 2 e i fratelli
What should you know about Net Core?
Docker - Demo on PHP Application deployment
Geek Sync I Working with SQL Server for Linux Cross-Platform
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
OpenShift 4 installation
OpenShift_Installation_Deep_Dive_Robert_Bohne.pdf
Kubernetes for the PHP developer
Fluo CICD OpenStack Summit
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
Visual studio 2015 and .net core 5 – get ready to rumble
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
ASP.NET vNext
Ad

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
System and Network Administraation Chapter 3
PDF
AI in Product Development-omnex systems
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Transform Your Business with a Software ERP System
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Digital Strategies for Manufacturing Companies
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Essential Infomation Tech presentation.pptx
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
System and Network Administration Chapter 2
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
top salesforce developer skills in 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
ai tools demonstartion for schools and inter college
System and Network Administraation Chapter 3
AI in Product Development-omnex systems
Design an Analysis of Algorithms II-SECS-1021-03
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Transform Your Business with a Software ERP System
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Digital Strategies for Manufacturing Companies
Odoo POS Development Services by CandidRoot Solutions
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Essential Infomation Tech presentation.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Design an Analysis of Algorithms I-SECS-1021-03
System and Network Administration Chapter 2
2025 Textile ERP Trends: SAP, Odoo & Oracle
top salesforce developer skills in 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development

Install .Net Core, SQL Server V-Next on Linux and deploy .Net core application and sql server database on Linux

  • 1. Deploy .Net application and SQL server database on linux environment Ajith Ramawickrama Chief Technology Officer FinTechnology Asia Pasific.
  • 3. Introduction Microsoft has been working with Linux for a number of years in order to facilitate their customers to run work loads in both Windows and Linux platforms. Followings are the few achievements Linux on your Datacenter – Hyper-V Linux on Azure .Net Core Visual Studio Code – Official IDE for .Net core on Linux and OSX SQL Server V-Next (Production release on mid 2017)
  • 4. .Net Core .Net Core is a cross platform, open source, general purpose , modular application development framework developed by Microsoft. Unlike other .Net framework, .Net core has built from the stretch using .Net standards. It contains most of APIs as the .Net standard framework, but .net core is a smaller set which includes runtime, framework, compiler and tools components that support a variety of operating systems and chip targets. .Net runs on Windows, Linux and OS-x operating systems.
  • 6. Advantages of .Net core Flexible deployment: Can be included in your app or installed side-by-side user- or machine-wide. Cross-platform: Runs on Windows, macOS and Linux Command-line tools: All product scenarios can be exercised at the command-line. Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard. Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses.  Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support Runs on Docker. Comes with inbuilt web server Kerstral
  • 7. Supporting Linux Systems Ubuntu – 14.04,16.04,16.10 Red Hat Enterprise Linux Linux Mint -17,18 Debian 8 Fedora CentOS 7.1 Oracle Linux 7.1 Open SUSE
  • 8. Install .Net core on Ubuntu 16.04 LTS 1) Preparing the system for installation In order to apt-get feed that hosts the package you need Run following commands in the console one after another • sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' • sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 • sudo apt-get update 2) Install .Net Code SDK Run Following command in order to install .Net Core SDK sudo apt-get install dotnet-dev-1.0.4
  • 9. Deploy FinAp Formula in Ubuntu 16.04 There are two types of deployment options available in .Net core 1) Framework dependent deployment  .Net core should be pre installed  Size of the deployment package is very small  Reduce the disk and memory usage of deployment server 2) Self contained deployment  Create deployment package including all framework dependencies and other third party dependencies  No need to install .Net core on target server  Need to set target platform at the time of deployment package creation  Large deployment package
  • 10. Framework dependent deployment  Go to your solution folder in windows command prompt  Run the command “dotnet restore” in order to make sure that all the dependencies are properly restored  Navigate to ASP.Net application(web or web api) folder and run the command “dotnet build” to build the solution  Run the command “dotnet publish -f netcoreapp1.1 -c Release” to create deployment package  Copy created package to Ubuntu PC  Go to the copied directory and run “dotnet executable-name.dll” in ubuntu terminal
  • 11. SQL Server VNext • SQL Server 2017 represents a major step towards making SQL Server a platform that gives you choices of development languages, data types, on-premises and in the cloud, and across operating systems by bringing the power of SQL Server to Linux, Linux-based Docker containers, and Windows. • Newest version is SQL Server 2017 CTP 2.1. According to Microsoft Production version to be released on mid 2017 • Currently Support Linux Versions • Red Hat Enterprise Linux • SUSE Linux Enterprise Server • Ubuntu 16.04 • Docker Engine 1.8 +
  • 12. Install SQL Server Vnext on Ubuntu 16.04 • Minimum System Requirements • Memory- 3.25 GB • File System- XFS or EXT4 • Disk Space - 1GB • Processor Speed -1.4 Ghz • Processor Cores – 2 cores • Processor Type – X64 only
  • 13. 1) Import the public repository GPG keys curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - 2) Register the Microsoft SQL Server Ubuntu repository: curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list 3) Install SQL Server sudo apt-get update sudo apt-get install -y mssql-server 4) Config SQL Server sudo /opt/mssql/bin/mssql-conf setup 5) Check the status systemctl status mssql-server
  • 14. Install SQL tools on Ubuntu 1) Import the public repository GPG keys. curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add – Register the Microsoft Ubuntu repository. curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list 3) unixODBC developer package sudo apt-get update sudo apt-get install mssql-tools unixodbc-dev 4) Update MsSql tools sudo apt-get update sudo apt-get install mssql-tools 5) Set PATH variable echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc
  • 15. Restore SQL Server Backup On Ubuntu • Take a backup of the database from Windows machine • Transfer backup to Linux (VMWare Tools/PUTTY,SSH) • Move the backup files to SQL directory Enter Super user mode sudo su Create Backup Directory On /var/opt/mssql mkdir -p /var/opt/mssql/backup Move Backup files mv /home/user1/AdventureWorks2014.bak /var/opt/mssql/backup/
  • 16. • Restore database sqlcmd -S localhost -U SA RESTORE DATABASE FinApCore FROM DISK = '/var/opt/mssql/backup/backupName.bak' WITH MOVE ‘FinApCore_Data' TO '/var/opt/mssql/data/FinapCore_Data.mdf', MOVE ‘FinApCore_Log' TO '/var/opt/mssql/data/FinApCore_Log.ldf' GO
  • 17. Why we Need Reverse Proxy? • Kestrel is the default web server for .net core which is serving dynamic contents • Reverse Proxy Allows Us to • serving static content • caching requests • compressing requests • SSL termination from the HTTP server • IIS Works as the reverse proxy for windows and NginX or Apache works as the reverse proxy for Linux