The Australian lapped the twisty Hungaroring track in the morning heat with a best time on soft tyres of one minute 17.613 seconds, 0.079 faster than Ferrari's Sebastian Vettel who was on quicker ultrasofts.
Ricciardo won from pole in Monaco this year, with Hungary's comparatively slow speed track referred to by some as 'Monaco without walls', and took grid penalties in Germany last weekend to give himself the best shot for the Hungaroring.
Red Bull's 20-year-old Dutch driver Max Verstappen was third on the timesheets, 0.088 slower than his team mate, with Ferrari's Kimi Raikkonen fourth.
Hungarian Grand Prix
Vettel puts Ferrari ahead in practice two
27/07/2018 AT 15:15
Formula One champions Mercedes filled the fifth and sixth places, with overall leader Lewis Hamilton 0.423 off the pace and Finnish team mate Valtteri Bottas 0.857 slower than Ricciardo.
Hamilton is 17 points clear of Vettel in the standings after 11 races, with Sunday's round the last before the sport's August break.
The Briton, who has won five times in Hungary but never in a championship year, suffered a big slide into the chicane on the dusty asphalt.
Renault's Nico Hulkenberg stopped on track with an engine problem and missed the last half hour.
Italian reserve Antonio Giovinazzi replaced race regular Charles Leclerc at Sauber for the opening session.
British Grand Prix
'No set-up makes this car a Ferrari or Red Bull' - Mercedes engineer ahead of British GP
Formula 1
Gasly extends AlphaTauri contract to 2023