latest terra/tmap packages not deploying on posit connect cloud (libproj.so.25 dependency issue)

My basic app.R below fails to deploy on posit connect cloud. Does posit have to install something on the posit cloud infrastructure for terra and related packages to deploy? Or is there some other fix?

Thanks

2026-08-19T10:37:25+01:00 Error: package or namespace load failed for ‘terra’ in dyn.load(file, DLLpath = DLLpath, ...):
2026-08-19T10:37:25+01:00 unable to load shared object '/cloud/lib/x86_64-pc-linux-gnu-library/4.6/terra/libs/terra.so':
2026-08-19T10:37:25+01:00 libproj.so.25: cannot open shared object file: No such file or directory
2026-08-19T10:37:25+01:00 Execution halted
2026-08-19T10:37:25+01:00 Shiny application exiting ...
2026-08-19T10:37:25+01:00 Failed to connect: worker has exited
2026-08-19T10:37:25+01:00 Worker complete: exited unexpectedly with code 1
2026-08-19T10:37:25+01:00 Worker error: exit status 1
2026-08-19T10:37:25+01:00 Worker process stopped
2026-08-19T10:37:25+01:00 Failed to publish content: Your application failed to start. error_id=ec50012f-d556-4b69-a5db-67acf1197e91

library(shiny)
library(terra)

ui <- fluidPage(

    titlePanel("Terra Test"),
    
        mainPanel(
           plotOutput("distPlot"),
        )
)

server <- function(input, output) {

    output$distPlot <- renderPlot({
    	# I suppose the following line may not work on posit connect cloud, but I can't get this far to see.  	
         	f <- system.file("ex/elev.tif", package="terra") 
        	r <- rast(f)
        	plot(r)
    })
}
shinyApp(ui = ui, server = server)

Just posting to say that I am experiencing the same issue.

1 Like

In case it helps, I think I found a fix on another thread related to shinyapps.io. This fix involves uing an older version of terra (i.e., version 1.8-93). For example, you can install it with the following:

remotes::install_version("terra", "1.8-93")

Alternatively, if you are using renv for package management, you could try this:

renv:install("terra@1.8-93")
1 Like

Thank you. I can get terra 1.9-27 to deploy on posit connect cloud, but terra 1.9-34 and later (or anthing depending on them) fail to deploy.

I have attempted to request tech support.

Posit support confirm terra/GDAL/libproj dependency issues on posit connect cloud. Avoid terra versions after v 1.9-27 and before v 1.9-38 if you need to deploy on posit connect cloud. (the latest dev version of terra does deploy, but takes time).
See

terra has released v1.9-46 to CRAN and this solves this problem :+1:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.