Which ports are used for install.packages() function ?

which ports have to be open for install.packages() function ? i dont want to open fully the server on which rstudio server is running. Thank you

This function will contact the cran repos you'll set

something like https://cran.rstudio.com
https is port 443 by default.
http is 80

I think that should be enough.

You can also be interested on an internal cran mirror on your network.
And byRStudio Package Manager product that will be useful for this.