Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SCP File from local to Heroku Server

Tags:

linux

scp

heroku

I'd like to copy my config.yml file from my local django app directory to my heroku server, but I'm not sure how to get the [email protected] format for heroku.

I've tried running 'heroku run bash'

scp  /home/user/app/config.yml

I'm not sure how I can get it in the

scp [email protected]:/home/user/dir1/file.txt [email protected]:/home/user/dir2' 

format

like image 405
user2738206 Avatar asked Jan 04 '15 03:01

user2738206


People also ask

Can I store files on Heroku?

Heroku has an “ephemeral” hard drive, this means that you can write files to disk, but those files will not persist after the application is restarted. By default Active Storage uses a :local storage option, which uses the local file system to store any uploaded files.

Can Heroku use localhost?

Start your app locally using the heroku local command, which is installed as part of the Heroku CLI. Your app should now be running on http://localhost:5000/.

How do I upload to Heroku?

The Simple File Upload dashboard allows you to access your exact script tag and see your current usage. or by visiting the Heroku Dashboard and selecting the application in question. Select Simple File Upload from the Add-ons menu.


2 Answers

As @tamas7 said it's firewalled, but your local machine is probably also firewalled. So unless you have a private server with SSH accessible from the Internet, you won't be able to scp.

I'm personally using transfer.sh free and open source service.

Upload your config.yml to it:

$ curl --upload-file ./config.yml https://transfer.sh/
https://transfer.sh/66nb8/config.yml

Then download it back from wherever you want:

$ wget https://transfer.sh/66nb8/config.yml
like image 130
Andre Miras Avatar answered Sep 19 '22 08:09

Andre Miras


According to http://www.evans.io/posts/heroku-survival-guide/ incoming connections are firewalled off. In this case you need to approach your local machine from the Heroku server.

heroku run bash
scp user@mylocalmachine:/home/user/dir/file.txt .
like image 45
tamas7 Avatar answered Sep 19 '22 08:09

tamas7