- 전체
- Sample DB
- database modeling
- [표준 SQL] Standard SQL
- G-SQL
- 10-Min
- ORACLE
- MS SQLserver
- MySQL
- SQLite
- postgreSQL
- 데이터아키텍처전문가 - 국가공인자격
- 데이터 분석 전문가 [ADP]
- [국가공인] SQL 개발자/전문가
- NoSQL
- hadoop
- hadoop eco system
- big data (빅데이터)
- stat(통계) R 언어
- XML DB & XQuery
- spark
- DataBase Tool
- 데이터분석 & 데이터사이언스
- Engineer Quality Management
- [기계학습] machine learning
- 데이터 수집 및 전처리
- 국가기술자격 빅데이터분석기사
- 암호화폐 (비트코인, cryptocurrency, bitcoin)
stat(통계) R 언어 How to Deploy Interactive R Apps with Shiny Server
2021.02.13 21:16
How to Deploy Interactive R Apps with Shiny Server
How to Deploy Interactive R Apps with Shiny Server
Updated , by Jared Kobos

What is Shiny?
Shiny is a library for the R programming language that allows you to create interactive web apps in native R, without needing to use web technologies such as HTML, CSS, or JavaScript. There are many ways to deploy Shiny apps to the web; this guide uses Shiny Server to host an example Shiny app on a Linode.
Before You Begin
If you do not have RStudio installed on your local computer, follow our How to Deploy RStudio Using an NGINX Reverse Proxy guide to set up a remote workstation on a Linode.
Build a Shiny Test App
Shiny Server comes with pre-installed demo apps. However, in order to demonstrate the process of deploying an app, you will create an app locally and deploy it to a Shiny Server on a Linode.
-
Open RStudio and install the Shiny package:
install.packages('shiny') -
In the File menu, under New File, select Shiny Web App…. When prompted, choose a name for your project. Select Multiple File and choose a directory to store the new app’s files.

-
Rstudio automatically opens two new files:
ui.Randserver.R. These files are pre-filled with a demo app that will create an interactive histogram of R’s built-in Old Faithful data set. Editserver.Rto adjust the formatting of the histogram according to your tastes. For example, to change the bars to red with a black border:hist(x, breaks = bins, col = 'red', border = 'black') -
To test the project locally, click Run App in the upper right corner of the text editor.
-
Save the project and copy the files to your Linode. Replace
usernamewith your Unix account username andlinodeIPwith the public IP address or domain name of your Linode:scp -r ~/shiny/Example username@linodeIP:/home/username
Deploy a Shiny App to a Remote Server
The steps in this section should be completed on your Linode.
Install R
-
Open
/etc/apt/sources.listand add the following line to the end of the file:Ubuntu:
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/Debian:
deb http://cran.rstudio.com/bin/linux/debian stretch-cran34/ -
Add the key ID for the CRAN network:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9sudo apt install dirmngr sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF' -
Update the repository:
sudo apt update -
Install the R binaries:
sudo apt install r-base
Add the Shiny Package
Use install.packages() to add the Shiny package:
sudo su - \
-c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\""
Install Shiny Server
-
Install
gdebi:sudo apt install gdebi-core -
Download Shiny Server:
wget https://download3.rstudio.org/ubuntu-12.04/x86_64/shiny-server-1.5.6.875-amd64.deb -
Use
gdebito install the Shiny Server package:sudo gdebi shiny-server-1.5.6.875-amd64.deb -
The
shiny-serverservice should start automatically. Check its status:sudo systemctl status shiny-server.service -
In a browser, navigate to your Linode’s public IP address or FQDN on port
3838(e.g.example.com:3838). You should see the Shiny Server welcome page:
Deploy Your App
By default, Shiny Server uses /srv/shiny-server/ as its site directory. Any Shiny apps in this directory will be served automatically.
-
Copy the example app directory into
/srv/shiny-server/:sudo cp -r Example/ /srv/shiny-server/ -
In a web browser, navigate to the app’s address. Replace
example.comwith your Linode’s public IP address or FQDN:example.com:3838/ExampleYou should see your app displayed:

Configure Shiny Server
Shiny Server’s configuration file is stored at /etc/shiny-server/shiny-server.conf:
- File: /etc/shiny-server/shiny-server.conf
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21# Instruct Shiny Server to run applications as the user "shiny" run_as shiny; # Define a server that listens on port 3838 server { listen 3838; # Define a location at the base URL location / { # Host the directory of Shiny Apps stored in this directory site_dir /srv/shiny-server; # Log all Shiny output to files in this directory log_dir /var/log/shiny-server; # When a user visits the base URL rather than a particular application, # an index of the applications available in this directory will be shown. directory_index on; } }
You can edit the port that Shiny Server will listen on, or change the site directory from which apps are served. The directory_index option allows visitors to view the contents of a directory by navigating to that path (for example, visiting example.com:3838/sample-apps will show a list of the example apps included in the Shiny Server installation). You can disable this behavior and hide the contents of directories by setting this option to off. For more information about configuring Shiny Server, see the official Administrator’s Guide.
After making changes to this file, restart the shiny-server service:
sudo systemctl restart shiny-server.service
[출처] https://www.linode.com/docs/guides/how-to-deploy-rshiny-server-on-ubuntu-and-debian/
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 공지 | 오라클 기본 샘플 데이터베이스 | 졸리운_곰 | 2014.01.02 | 86174 |
| 공지 | [SQL컨셉] 서적 "SQL컨셉"의 샘플 데이타 베이스 SAMPLE DATABASE of ORACLE | 가을의 곰을... | 2013.02.10 | 78664 |
| 공지 | [G_SQL] Sample Database | 가을의 곰을... | 2012.05.20 | 95397 |
| 13 |
[데이터 수집 및 전처리] 주식 전종목 어떻게 불러올까? 거래소 종목 불러오기
| 졸리운_곰 | 2023.12.09 | 1701 |
| 12 |
[데이터 수집 및 전처리] [Python/파이썬]네이버증권API 활용 - 회사명, 종목코드 받아오기
| 졸리운_곰 | 2023.12.08 | 1509 |
| 11 |
[데이터 수집 및 전처리] 네이버 금융(차트)에서 주가 갈무리(크롤링)하기
| 졸리운_곰 | 2023.12.08 | 1495 |
| 10 |
[데이터 수집 및 전처리] 네이버 증권에서 일봉, 주봉 데이터 가져오기
| 졸리운_곰 | 2023.12.08 | 1499 |
| 9 |
[데이터 수집 및 전처리] (놀라운) 한글 데이터 짱! AwesomeKorean_Data
| 졸리운_곰 | 2023.03.07 | 1197 |
| 8 |
[데이터 수집 및 전처리] Crawling, Scraping
| 졸리운_곰 | 2022.05.21 | 1476 |
| 7 |
[데이터분석][데이터수집 전처리] MS 엑셀(Excel)에서 UTF-8 로 된 csv 파일 가져오기
| 졸리운_곰 | 2021.09.30 | 1415 |
| 6 | 카프카 설치 시 가장 중요한 설정 4가지 | 졸리운_곰 | 2021.07.13 | 1928 |
| 5 |
Prometheus Query(PromQL) 기본 이해하기
| 졸리운_곰 | 2020.12.17 | 1413 |
| 4 |
[인프라 모니터링 오픈소스] Prometheus 를 알아보자
| 졸리운_곰 | 2020.12.17 | 1906 |
| 3 |
Prometheus + Grafana 대시보드
| 졸리운_곰 | 2020.12.17 | 2488 |
| 2 |
Grafana란?
| 졸리운_곰 | 2020.12.17 | 2158 |
| 1 | Importing wikipedia dump to MySql | 졸리운_곰 | 2020.10.04 | 2494 |

