(Many ways) How to upload files into Oracle Cloud Infrastructure – Cloud Shell


Oracle Cloud Infrastructure Cloud Shell is VM that runs inside OCI -to be used for manipulating OCI resources using various means, including OCI CLI, Terraform and Ansible. We may want to be able to get files into Cloud Shell – scripts, source code, Infrastructure as Code and more. There are many ways in which we can these files into Cloud Shell. Let me quickly sum up a few that come to mind:


  • create a file inside Cloud Shell, open it using an editor such as vi or nano and paste in the contents
  • commit the file to a Git Repo and clone the repo to the Cloud Shell
  • put the file on OCI Object Storage and download said file using OCI CLI: oci os object get -bn <bucket name> –name <object name> –file <download-as-file-name>
  • put the file on OCI Object Storage, create a pre-authenticated request  and use the URL in a curl or wget operation in Cloud Shell to download the file
  • put the file on a public site (Dropbox, OneDrive, Google Drive) and download the file from there
  • put the file in a Docker Container, push the container image to a Container Registry, pull the image into Cloud Shell, start a container and docker cp the files from the container to the Cloud Shell host storage
  • create a REST API (for example using Node) to which files can be uploaded – and will be saved locally by the web application; then use ngrok to create a public endpoint that links up with the REST API and post files to this endpoint. They are forwarded through the ngrok public cloud to the application running locally on Cloud Shell and saved on the Cloud Shell storage

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.