The majority of experimental studies of the effects of population bottlenecks on fitness are performed under laboratory conditions, which do not account for the environmental complexity that populations face in nature. In this study, we test inbreeding depression in multiple replicates of inbred when compared with non-inbred lines of Drosophila melanogaster under different temperature conditions. Egg-to-adult viability, developmental time and sex ratio of emerging adults are studied under low, intermediate and high temperatures under laboratory as well as semi-natural conditions. The results show inbreeding depression for egg-to-adult viability. The level of inbreeding depression is highly dependent on test temperature and is observed only at low and high temperatures. Inbreeding did not affect the developmental time or the sex ratio of emerging adults. However, temperature affected the sex ratio with more females relative to males emerging at low temperatures, suggesting that selection against males in pre-adult life stages is stronger at low temperatures. The coefficient of variation (CV) of egg-to-adult viability within and among lines is higher for inbred flies and generally increases at stressful temperatures. Our results contribute to knowledge on the environmental dependency of inbreeding under different environmental conditions and emphasize that climate change may impact negatively on fitness through synergistic interactions with the genotype.